diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-03 07:25:02 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-03 07:25:02 +0900 |
| commit | d36b129369ccb67dcba27b2cd3544fdf270abef7 (patch) | |
| tree | 2def2685ddce8bbeca8dfaeaecb38d9ff97f2592 /src/server/api | |
| parent | Fetch more reactins (diff) | |
| download | sharkey-d36b129369ccb67dcba27b2cd3544fdf270abef7.tar.gz sharkey-d36b129369ccb67dcba27b2cd3544fdf270abef7.tar.bz2 sharkey-d36b129369ccb67dcba27b2cd3544fdf270abef7.zip | |
Improve reaction tooltip
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/notes/reactions.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server/api/endpoints/notes/reactions.ts b/src/server/api/endpoints/notes/reactions.ts index 7bea24d316..742489c0cd 100644 --- a/src/server/api/endpoints/notes/reactions.ts +++ b/src/server/api/endpoints/notes/reactions.ts @@ -4,6 +4,8 @@ import define from '../../define'; import { getNote } from '../../common/getters'; import { ApiError } from '../../error'; import { NoteReactions } from '../../../../models'; +import { DeepPartial } from 'typeorm'; +import { NoteReaction } from '../../../../models/entities/note-reaction'; export const meta = { desc: { @@ -24,6 +26,10 @@ export const meta = { } }, + type: { + validator: $.optional.nullable.str, + }, + limit: { validator: $.optional.num.range(1, 100), default: 10 @@ -70,7 +76,11 @@ export default define(meta, async (ps, user) => { const query = { noteId: note.id - }; + } as DeepPartial<NoteReaction>; + + if (ps.type) { + query.reaction = ps.type; + } const reactions = await NoteReactions.find({ where: query, |