summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/drive/files
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-20 15:50:13 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-20 15:50:13 +0900
commitc4e8cabae90b59d5842db2f789eb0cd8ee1fcac4 (patch)
tree63858f94ea5296699d44ddea3d52bf99b2605caf /src/server/api/endpoints/drive/files
parentLocalized mark all as read message (#2956) (diff)
downloadsharkey-c4e8cabae90b59d5842db2f789eb0cd8ee1fcac4.tar.gz
sharkey-c4e8cabae90b59d5842db2f789eb0cd8ee1fcac4.tar.bz2
sharkey-c4e8cabae90b59d5842db2f789eb0cd8ee1fcac4.zip
ファイル作成APIにforceオプションを実装
Diffstat (limited to 'src/server/api/endpoints/drive/files')
-rw-r--r--src/server/api/endpoints/drive/files/create.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts
index 4b5ffa90e0..29e65a7ad3 100644
--- a/src/server/api/endpoints/drive/files/create.ts
+++ b/src/server/api/endpoints/drive/files/create.ts
@@ -31,19 +31,23 @@ export const meta = {
}
}),
- isSensitive: $.bool.optional.nullable.note({
- default: null,
+ isSensitive: $.bool.optional.note({
+ default: false,
desc: {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
}
+ }),
+
+ force: $.bool.optional.note({
+ default: false,
+ desc: {
+ 'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。',
+ }
})
}
};
-/**
- * Create a file
- */
export default async (file: any, params: any, user: ILocalUser): Promise<any> => {
if (file == null) {
throw 'file is required';
@@ -76,7 +80,7 @@ export default async (file: any, params: any, user: ILocalUser): Promise<any> =>
try {
// Create file
- const driveFile = await create(user, file.path, name, null, ps.folderId, false, false, null, null, ps.isSensitive);
+ const driveFile = await create(user, file.path, name, null, ps.folderId, ps.force, false, null, null, ps.isSensitive);
cleanup();