This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@@ -15,29 +15,29 @@ export const meta = {
params: {
folderId: {
validator: $.type(ID),
}
},
},
errors: {
noSuchFolder: {
message: 'No such folder.',
code: 'NO_SUCH_FOLDER',
id: '1069098f-c281-440f-b085-f9932edbe091'
id: '1069098f-c281-440f-b085-f9932edbe091',
},
hasChildFilesOrFolders: {
message: 'This folder has child files or folders.',
code: 'HAS_CHILD_FILES_OR_FOLDERS',
id: 'b0fc8a17-963c-405d-bfbc-859a487295e1'
id: 'b0fc8a17-963c-405d-bfbc-859a487295e1',
},
}
},
};
export default define(meta, async (ps, user) => {
// Get folder
const folder = await DriveFolders.findOne({
id: ps.folderId,
userId: user.id
userId: user.id,
});
if (folder == null) {
@@ -46,7 +46,7 @@ export default define(meta, async (ps, user) => {
const [childFoldersCount, childFilesCount] = await Promise.all([
DriveFolders.count({ parentId: folder.id }),
DriveFiles.count({ folderId: folder.id })
DriveFiles.count({ folderId: folder.id }),
]);
if (childFoldersCount !== 0 || childFilesCount !== 0) {