summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-06 04:28:22 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-06 04:28:22 +0900
commite2c6227f4713b91d94355c69d619ac2d5d865c1b (patch)
tree35e298f209a5ef4a651f62150938128f6a880129 /src/server/api/endpoints/notes
parent互換性のためのコードを追加 & #2623 (diff)
downloadsharkey-e2c6227f4713b91d94355c69d619ac2d5d865c1b.tar.gz
sharkey-e2c6227f4713b91d94355c69d619ac2d5d865c1b.tar.bz2
sharkey-e2c6227f4713b91d94355c69d619ac2d5d865c1b.zip
Improve local timeline API
Diffstat (limited to 'src/server/api/endpoints/notes')
-rw-r--r--src/server/api/endpoints/notes/local-timeline.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts
index 2458a70556..ce84b4135a 100644
--- a/src/server/api/endpoints/notes/local-timeline.ts
+++ b/src/server/api/endpoints/notes/local-timeline.ts
@@ -23,6 +23,12 @@ export const meta = {
}
}),
+ fileType: $.arr($.str).optional.note({
+ desc: {
+ 'ja-JP': '指定された種類のファイルが添付された投稿のみを取得します'
+ }
+ }),
+
limit: $.num.optional.range(1, 100).note({
default: 10
}),
@@ -84,6 +90,14 @@ export default async (params: any, user: ILocalUser) => {
query.fileIds = { $exists: true, $ne: [] };
}
+ if (ps.fileType) {
+ query.fileIds = { $exists: true, $ne: [] };
+
+ query['_files.contentType'] = {
+ $in: ps.fileType
+ };
+ }
+
if (ps.sinceId) {
sort._id = 1;
query._id = {