Conditional hydration of folder_anchor
All checks were successful
All checks were successful
This commit is contained in:
parent
64918e94f0
commit
bac90f003c
@ -170,16 +170,18 @@ export default class OfficeFoldersController extends ApiController {
|
||||
return;
|
||||
}
|
||||
|
||||
const officeFolderAnchorFound = OfficeFolderAnchor.hydrate<OfficeFolderAnchor>(officeFolderFound.folder_anchor, {
|
||||
strategy: "excludeAll",
|
||||
});
|
||||
|
||||
if (officeFolderAnchorFound) {
|
||||
this.httpBadRequest(response, {
|
||||
error: "Office folder already anchored",
|
||||
folder_anchor: officeFolderAnchorFound,
|
||||
if (officeFolderFound.folder_anchor) {
|
||||
const officeFolderAnchorFound = OfficeFolderAnchor.hydrate<OfficeFolderAnchor>(officeFolderFound.folder_anchor, {
|
||||
strategy: "excludeAll",
|
||||
});
|
||||
return;
|
||||
|
||||
if (officeFolderAnchorFound) {
|
||||
this.httpBadRequest(response, {
|
||||
error: "Office folder already anchored",
|
||||
folder_anchor: officeFolderAnchorFound,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const officeFolder = OfficeFolder.hydrate<OfficeFolder>(officeFolderFound, { strategy: "excludeAll" });
|
||||
|
Loading…
x
Reference in New Issue
Block a user