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/local-timeline.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/local-timeline.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/local-timeline.ts | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index 510564129c..78ddf00626 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.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 Mute from '../../../../models/mute'; import { packMany } from '../../../../models/note'; @@ -12,42 +12,57 @@ export const meta = { }, params: { - withFiles: $.bool.optional.note({ + withFiles: { + validator: $.bool.optional, desc: { 'ja-JP': 'ファイルが添付された投稿に限定するか否か' } - }), + }, - mediaOnly: $.bool.optional.note({ + mediaOnly: { + validator: $.bool.optional, desc: { 'ja-JP': 'ファイルが添付された投稿に限定するか否か (このパラメータは廃止予定です。代わりに withFiles を使ってください。)' } - }), + }, - fileType: $.arr($.str).optional.note({ + fileType: { + validator: $.arr($.str).optional, desc: { 'ja-JP': '指定された種類のファイルが添付された投稿のみを取得します' } - }), + }, - excludeNsfw: $.bool.optional.note({ + excludeNsfw: { + validator: $.bool.optional, default: false, desc: { 'ja-JP': 'true にすると、NSFW指定されたファイルを除外します(fileTypeが指定されている場合のみ有効)' } - }), + }, - limit: $.num.optional.range(1, 100).note({ + limit: { + validator: $.num.optional.range(1, 100), default: 10 - }), + }, - sinceId: $.type(ID).optional.note({}), + sinceId: { + validator: $.type(ID).optional, + transform: transform, + }, - untilId: $.type(ID).optional.note({}), + untilId: { + validator: $.type(ID).optional, + transform: transform, + }, - sinceDate: $.num.optional.note({}), + sinceDate: { + validator: $.num.optional, + }, - untilDate: $.num.optional.note({}), + untilDate: { + validator: $.num.optional, + }, } }; |