summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-22 17:04:52 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-22 17:04:52 +0900
commitd2d3a7d52b78b7d7d1da4380b062ac2279948cae (patch)
tree5e17286dfe020c58ff4b8bfcd7c91fd9a3bab2b5 /src/server/api/endpoints/notes
parent[wip] #1455 (diff)
downloadsharkey-d2d3a7d52b78b7d7d1da4380b062ac2279948cae.tar.gz
sharkey-d2d3a7d52b78b7d7d1da4380b062ac2279948cae.tar.bz2
sharkey-d2d3a7d52b78b7d7d1da4380b062ac2279948cae.zip
CW
Diffstat (limited to 'src/server/api/endpoints/notes')
-rw-r--r--src/server/api/endpoints/notes/create.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts
index 14e906eb9d..ea1f41aae2 100644
--- a/src/server/api/endpoints/notes/create.ts
+++ b/src/server/api/endpoints/notes/create.ts
@@ -23,11 +23,11 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
if (visibilityErr) return rej('invalid visibility');
// Get 'text' parameter
- const [text, textErr] = $(params.text).optional.string().pipe(isValidText).$;
+ const [text = null, textErr] = $(params.text).optional.nullable.string().pipe(isValidText).$;
if (textErr) return rej('invalid text');
// Get 'cw' parameter
- const [cw, cwErr] = $(params.cw).optional.string().pipe(isValidCw).$;
+ const [cw, cwErr] = $(params.cw).optional.nullable.string().pipe(isValidCw).$;
if (cwErr) return rej('invalid cw');
// Get 'viaMobile' parameter
@@ -187,14 +187,14 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
const note = await create(user, {
createdAt: new Date(),
media: files,
- poll: poll,
- text: text,
+ poll,
+ text,
reply,
renote,
- cw: cw,
- tags: tags,
- app: app,
- viaMobile: viaMobile,
+ cw,
+ tags,
+ app,
+ viaMobile,
visibility,
geo
});