diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-24 18:13:06 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-24 18:13:06 +0900 |
| commit | 7602e8f9383be37c0f7d9359f862c366b7f2fa00 (patch) | |
| tree | 013dc2467b4a2e028371d4cf94f42a138d2eb4d5 /src/server/api/endpoints/notes/reactions | |
| parent | Better japanese (diff) | |
| download | sharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.tar.gz sharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.tar.bz2 sharkey-7602e8f9383be37c0f7d9359f862c366b7f2fa00.zip | |
cafy 5.xに移行
Diffstat (limited to 'src/server/api/endpoints/notes/reactions')
| -rw-r--r-- | src/server/api/endpoints/notes/reactions/create.ts | 4 | ||||
| -rw-r--r-- | src/server/api/endpoints/notes/reactions/delete.ts | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/server/api/endpoints/notes/reactions/create.ts b/src/server/api/endpoints/notes/reactions/create.ts index 9e217cc3e0..1c21252604 100644 --- a/src/server/api/endpoints/notes/reactions/create.ts +++ b/src/server/api/endpoints/notes/reactions/create.ts @@ -1,7 +1,7 @@ /** * Module dependencies */ -import $ from 'cafy'; +import $ from 'cafy'; import ID from '../../../../../cafy-id'; import Note from '../../../../../models/note'; import create from '../../../../../services/note/reaction/create'; import { validateReaction } from '../../../../../models/note-reaction'; @@ -11,7 +11,7 @@ import { validateReaction } from '../../../../../models/note-reaction'; */ module.exports = (params, user) => new Promise(async (res, rej) => { // Get 'noteId' parameter - const [noteId, noteIdErr] = $(params.noteId).id().$; + const [noteId, noteIdErr] = $(params.noteId).type(ID).$; if (noteIdErr) return rej('invalid noteId param'); // Get 'reaction' parameter diff --git a/src/server/api/endpoints/notes/reactions/delete.ts b/src/server/api/endpoints/notes/reactions/delete.ts index b5d738b8ff..be3c1b214d 100644 --- a/src/server/api/endpoints/notes/reactions/delete.ts +++ b/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,21 +1,16 @@ /** * Module dependencies */ -import $ from 'cafy'; +import $ from 'cafy'; import ID from '../../../../../cafy-id'; import Reaction from '../../../../../models/note-reaction'; import Note from '../../../../../models/note'; -// import event from '../../../publishers/stream'; /** * Unreact to a note - * - * @param {any} params - * @param {any} user - * @return {Promise<any>} */ module.exports = (params, user) => new Promise(async (res, rej) => { // Get 'noteId' parameter - const [noteId, noteIdErr] = $(params.noteId).id().$; + const [noteId, noteIdErr] = $(params.noteId).type(ID).$; if (noteIdErr) return rej('invalid noteId param'); // Fetch unreactee |