Archive an unanchored folder

This commit is contained in:
Vins 2024-02-13 09:21:24 +01:00
parent f596aaa133
commit 3520a15a10

View File

@ -168,7 +168,7 @@ export default class OfficeFoldersController extends ApiController {
const officeFolderFound = await this.officeFoldersService.getByUid(uid, {
folder_anchor: true,
});
});
if (!officeFolderFound) {
this.httpNotFoundRequest(response, "office folder not found");
@ -184,11 +184,6 @@ export default class OfficeFoldersController extends ApiController {
//validate folder
await validateOrReject(officefolderToUpdate, { groups: ["updateFolder"], forbidUnknownValues: false });
if ((officeFolderFound as any).folder_anchor?.status !== "VERIFIED_ON_CHAIN") {
this.httpBadRequest(response, "Cannot archive a not anchored folder");
return;
}
//call service to get prisma entity
const officeFolderEntityUpdated = await this.officeFoldersService.updateStatus(uid, officefolderToUpdate);