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

@ -21,22 +21,22 @@ export const meta = {
parentId: {
validator: $.optional.nullable.type(ID),
}
},
},
errors: {
noSuchFolder: {
message: 'No such folder.',
code: 'NO_SUCH_FOLDER',
id: '53326628-a00d-40a6-a3cd-8975105c0f95'
id: '53326628-a00d-40a6-a3cd-8975105c0f95',
},
},
res: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'DriveFolder'
}
ref: 'DriveFolder',
},
};
export default define(meta, async (ps, user) => {
@ -46,7 +46,7 @@ export default define(meta, async (ps, user) => {
// Fetch parent folder
parent = await DriveFolders.findOne({
id: ps.parentId,
userId: user.id
userId: user.id,
});
if (parent == null) {
@ -60,7 +60,7 @@ export default define(meta, async (ps, user) => {
createdAt: new Date(),
name: ps.name,
parentId: parent !== null ? parent.id : null,
userId: user.id
userId: user.id,
}).then(x => DriveFolders.findOneOrFail(x.identifiers[0]));
const folderObj = await DriveFolders.pack(folder);