add other document type

This commit is contained in:
Arnaud D. Natali 2023-10-03 00:15:16 +02:00 committed by GitHub
commit 29fa7b42bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -8,8 +8,7 @@ export default async function folderHandler(req: Request, response: Response, ne
try { try {
const officeId = req.body.user.office_Id; const officeId = req.body.user.office_Id;
const userId = req.body.user.userId; const userId = req.body.user.userId;
const splittedReqPath = req.path && req.path.split("/"); let uid = req.path && req.path.split("/")[5];
const uid = (splittedReqPath as string[]).pop();
const office = req.body.office; const office = req.body.office;
const officeFolderNumber = req.body.folder_number; const officeFolderNumber = req.body.folder_number;
const deed = req.body.deed; const deed = req.body.deed;
@ -45,6 +44,9 @@ export default async function folderHandler(req: Request, response: Response, ne
} }
if (uid) { if (uid) {
if(uid === "download") {
uid = req.path && req.path.split("/")[6];
}
const officeFolder = await officeFolderService.getByUidWithStakeholders(uid!); const officeFolder = await officeFolderService.getByUidWithStakeholders(uid!);
if (!officeFolder) { if (!officeFolder) {

View File

@ -1540,6 +1540,15 @@ export default async function main() {
created_at: new Date(), created_at: new Date(),
updated_at: new Date(), updated_at: new Date(),
}, },
{
name: "Autres documents",
archived_at: null,
public_description: "Autres documents",
private_description: "Autres documents",
office: offices[0],
created_at: new Date(),
updated_at: new Date(),
}
]; ];
const deedTypes: DeedType[] = [ const deedTypes: DeedType[] = [