Update update.ts
This commit is contained in:
parent
0b7be70935
commit
33ea1db30d
1 changed files with 3 additions and 1 deletions
|
@ -83,7 +83,9 @@ export default define(meta, async (ps, user) => {
|
||||||
if (ps.name) folder.name = ps.name;
|
if (ps.name) folder.name = ps.name;
|
||||||
|
|
||||||
if (ps.parentId !== undefined) {
|
if (ps.parentId !== undefined) {
|
||||||
if (ps.parentId === null) {
|
if (ps.parentId.equals(folder._id)) {
|
||||||
|
throw new ApiError(meta.errors.recursiveNesting);
|
||||||
|
} else if (ps.parentId === null) {
|
||||||
folder.parentId = null;
|
folder.parentId = null;
|
||||||
} else {
|
} else {
|
||||||
// Get parent folder
|
// Get parent folder
|
||||||
|
|
Loading…
Reference in a new issue