summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes.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.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.ts')
-rw-r--r--src/server/api/endpoints/notes.ts47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts
index 4f5a211240..83776c59d0 100644
--- a/src/server/api/endpoints/notes.ts
+++ b/src/server/api/endpoints/notes.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, { packMany } from '../../../models/note';
import getParams from '../get-params';
@@ -8,49 +8,62 @@ export const meta = {
},
params: {
- local: $.bool.optional.note({
+ local: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ローカルの投稿に限定するか否か'
}
- }),
+ },
- reply: $.bool.optional.note({
+ reply: {
+ validator: $.bool.optional,
desc: {
'ja-JP': '返信に限定するか否か'
}
- }),
+ },
- renote: $.bool.optional.note({
+ renote: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'Renoteに限定するか否か'
}
- }),
+ },
- withFiles: $.bool.optional.note({
+ withFiles: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ファイルが添付された投稿に限定するか否か'
}
- }),
+ },
- media: $.bool.optional.note({
+ media: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ファイルが添付された投稿に限定するか否か (このパラメータは廃止予定です。代わりに withFiles を使ってください。)'
}
- }),
+ },
- poll: $.bool.optional.note({
+ poll: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'アンケートが添付された投稿に限定するか否か'
}
- }),
+ },
- 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,
+ },
}
};