This commit is contained in:
syuilo 2017-12-11 13:33:33 +09:00
parent 9852c57b8f
commit e36a708132
8 changed files with 157 additions and 11 deletions

View file

@ -38,9 +38,15 @@ module.exports = async (file, params, user): Promise<any> => {
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
if (folderIdErr) throw 'invalid folder_id param';
// Create file
const driveFile = await create(user, file.path, name, null, folderId);
try {
// Create file
const driveFile = await create(user, file.path, name, null, folderId);
// Serialize
return serialize(driveFile);
// Serialize
return serialize(driveFile);
} catch (e) {
console.error(e);
throw e;
}
};