summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/users/lists
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-02 18:06:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-02 18:06:16 +0900
commitf664cf09c0860e0cf9920722532c6315fa35a8a1 (patch)
tree119a57cf807ea105a68e14395420f8eb54ab7c5c /src/server/api/endpoints/users/lists
parentoops (diff)
downloadsharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.tar.gz
sharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.tar.bz2
sharkey-f664cf09c0860e0cf9920722532c6315fa35a8a1.zip
Update cafy to 8.0.0 :rocket:
Diffstat (limited to 'src/server/api/endpoints/users/lists')
-rw-r--r--src/server/api/endpoints/users/lists/create.ts2
-rw-r--r--src/server/api/endpoints/users/lists/push.ts4
-rw-r--r--src/server/api/endpoints/users/lists/show.ts2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/server/api/endpoints/users/lists/create.ts b/src/server/api/endpoints/users/lists/create.ts
index 79a680c736..100a78b872 100644
--- a/src/server/api/endpoints/users/lists/create.ts
+++ b/src/server/api/endpoints/users/lists/create.ts
@@ -9,7 +9,7 @@ import UserList, { pack } from '../../../../../models/user-list';
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'title' parameter
- const [title, titleErr] = $(params.title).string().range(1, 100).get();
+ const [title, titleErr] = $.str.range(1, 100).get(params.title);
if (titleErr) return rej('invalid title param');
// insert
diff --git a/src/server/api/endpoints/users/lists/push.ts b/src/server/api/endpoints/users/lists/push.ts
index ceb5692c81..da5a9a134c 100644
--- a/src/server/api/endpoints/users/lists/push.ts
+++ b/src/server/api/endpoints/users/lists/push.ts
@@ -11,7 +11,7 @@ import { deliver } from '../../../../../queue';
*/
module.exports = async (params, me) => new Promise(async (res, rej) => {
// Get 'listId' parameter
- const [listId, listIdErr] = $(params.listId).type(ID).get();
+ const [listId, listIdErr] = $.type(ID).get(params.listId);
if (listIdErr) return rej('invalid listId param');
// Fetch the list
@@ -25,7 +25,7 @@ module.exports = async (params, me) => new Promise(async (res, rej) => {
}
// Get 'userId' parameter
- const [userId, userIdErr] = $(params.userId).type(ID).get();
+ const [userId, userIdErr] = $.type(ID).get(params.userId);
if (userIdErr) return rej('invalid userId param');
// Fetch the user
diff --git a/src/server/api/endpoints/users/lists/show.ts b/src/server/api/endpoints/users/lists/show.ts
index 54e1df7b2f..16cb3382fd 100644
--- a/src/server/api/endpoints/users/lists/show.ts
+++ b/src/server/api/endpoints/users/lists/show.ts
@@ -6,7 +6,7 @@ import UserList, { pack } from '../../../../../models/user-list';
*/
module.exports = async (params, me) => new Promise(async (res, rej) => {
// Get 'listId' parameter
- const [listId, listIdErr] = $(params.listId).type(ID).get();
+ const [listId, listIdErr] = $.type(ID).get(params.listId);
if (listIdErr) return rej('invalid listId param');
// Fetch the list