Update update.ts

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-03-26 19:07:31 +09:00 committed by GitHub
parent 0b7be70935
commit 33ea1db30d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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