diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-02 03:32:24 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-02 03:32:24 +0900 |
| commit | 931bdc6aace5e7aa71ffdfb470e208ead78a2a53 (patch) | |
| tree | eee6d7bf5f5480b883bb601517b4d9db03f31e9f /src/server/api/endpoints/notes/reactions.ts | |
| parent | Refactoring (diff) | |
| download | sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.gz sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.bz2 sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.zip | |
Refactoring, Clean up and bug fixes
Diffstat (limited to 'src/server/api/endpoints/notes/reactions.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/reactions.ts | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/server/api/endpoints/notes/reactions.ts b/src/server/api/endpoints/notes/reactions.ts index 5f23068cd6..1ab5afaba1 100644 --- a/src/server/api/endpoints/notes/reactions.ts +++ b/src/server/api/endpoints/notes/reactions.ts @@ -1,4 +1,4 @@ -import $ from 'cafy'; import ID from '../../../../misc/cafy-id'; +import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id'; import Note from '../../../../models/note'; import Reaction, { pack } from '../../../../models/note-reaction'; import { ILocalUser } from '../../../../models/user'; @@ -13,26 +13,34 @@ export const meta = { requireCredential: false, params: { - noteId: $.type(ID).note({ + noteId: { + validator: $.type(ID), + transform: transform, desc: { 'ja-JP': '対象の投稿のID', 'en-US': 'The ID of the target note' } - }), + }, - limit: $.num.optional.range(1, 100).note({ + limit: { + validator: $.num.optional.range(1, 100), default: 10 - }), + }, - offset: $.num.optional.note({ + offset: { + validator: $.num.optional, default: 0 - }), + }, - sinceId: $.type(ID).optional.note({ - }), + sinceId: { + validator: $.type(ID).optional, + transform: transform, + }, - untilId: $.type(ID).optional.note({ - }), + untilId: { + validator: $.type(ID).optional, + transform: transform, + }, } }; |