diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-23 15:27:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-23 15:27:01 +0900 |
| commit | 02bb99ac029e8fc12aec384717341f603052d7c0 (patch) | |
| tree | 1dcce6bdb5f329f58e8e6772c6717f49d658863b /src/server/api/endpoints/notes | |
| parent | サーバーのバージョンとクライアントのバージョンを分... (diff) | |
| download | sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.tar.gz sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.tar.bz2 sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.zip | |
他のMisskeyインスタンスにリアクション情報を伝えるように
Diffstat (limited to 'src/server/api/endpoints/notes')
| -rw-r--r-- | src/server/api/endpoints/notes/reactions/create.ts | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/server/api/endpoints/notes/reactions/create.ts b/src/server/api/endpoints/notes/reactions/create.ts index c80c5416b1..9e217cc3e0 100644 --- a/src/server/api/endpoints/notes/reactions/create.ts +++ b/src/server/api/endpoints/notes/reactions/create.ts @@ -4,6 +4,7 @@ import $ from 'cafy'; import Note from '../../../../../models/note'; import create from '../../../../../services/note/reaction/create'; +import { validateReaction } from '../../../../../models/note-reaction'; /** * React to a note @@ -14,17 +15,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { if (noteIdErr) return rej('invalid noteId param'); // Get 'reaction' parameter - const [reaction, reactionErr] = $(params.reaction).string().or([ - 'like', - 'love', - 'laugh', - 'hmm', - 'surprise', - 'congrats', - 'angry', - 'confused', - 'pudding' - ]).$; + const [reaction, reactionErr] = $(params.reaction).string().pipe(validateReaction.ok).$; if (reactionErr) return rej('invalid reaction param'); // Fetch reactee |