summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/global-timeline.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-11-02 03:32:24 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-11-02 03:32:24 +0900
commit931bdc6aace5e7aa71ffdfb470e208ead78a2a53 (patch)
treeeee6d7bf5f5480b883bb601517b4d9db03f31e9f /src/server/api/endpoints/notes/global-timeline.ts
parentRefactoring (diff)
downloadsharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.gz
sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.bz2
sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.zip
Refactoring, Clean up and bug fixes
Diffstat (limited to 'src/server/api/endpoints/notes/global-timeline.ts')
-rw-r--r--src/server/api/endpoints/notes/global-timeline.ts35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts
index 8a6c848943..fa7a76f12e 100644
--- a/src/server/api/endpoints/notes/global-timeline.ts
+++ b/src/server/api/endpoints/notes/global-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,29 +12,42 @@ 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 を使ってください。)'
}
- }),
+ },
- 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
+ },
}
};