Archive an unanchored folder
This commit is contained in:
parent
f596aaa133
commit
3520a15a10
@ -168,7 +168,7 @@ export default class OfficeFoldersController extends ApiController {
|
|||||||
|
|
||||||
const officeFolderFound = await this.officeFoldersService.getByUid(uid, {
|
const officeFolderFound = await this.officeFoldersService.getByUid(uid, {
|
||||||
folder_anchor: true,
|
folder_anchor: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!officeFolderFound) {
|
if (!officeFolderFound) {
|
||||||
this.httpNotFoundRequest(response, "office folder not found");
|
this.httpNotFoundRequest(response, "office folder not found");
|
||||||
@ -184,11 +184,6 @@ export default class OfficeFoldersController extends ApiController {
|
|||||||
//validate folder
|
//validate folder
|
||||||
await validateOrReject(officefolderToUpdate, { groups: ["updateFolder"], forbidUnknownValues: false });
|
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
|
//call service to get prisma entity
|
||||||
const officeFolderEntityUpdated = await this.officeFoldersService.updateStatus(uid, officefolderToUpdate);
|
const officeFolderEntityUpdated = await this.officeFoldersService.updateStatus(uid, officefolderToUpdate);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user