diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2019-02-04 18:27:45 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2019-02-04 18:27:45 +0900 |
| commit | 68ee9a008e987b9a7dc1f9cf1fc010f9b9ed0f42 (patch) | |
| tree | ae7a24e70a21c3dfae4a4e3a92d63050b0ee1eca /src/server/api | |
| parent | Fix fusion (diff) | |
| download | sharkey-68ee9a008e987b9a7dc1f9cf1fc010f9b9ed0f42.tar.gz sharkey-68ee9a008e987b9a7dc1f9cf1fc010f9b9ed0f42.tar.bz2 sharkey-68ee9a008e987b9a7dc1f9cf1fc010f9b9ed0f42.zip | |
Resolve #4121 (#4122)
* Resolve #4121
* Update tslint.json
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/aggregation/hashtags.ts | 8 | ||||
| -rw-r--r-- | src/server/api/endpoints/hashtags/trend.ts | 10 | ||||
| -rw-r--r-- | src/server/api/stream/channels/hashtag.ts | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/server/api/endpoints/aggregation/hashtags.ts b/src/server/api/endpoints/aggregation/hashtags.ts index 7577711b5f..13d0e1e2a6 100644 --- a/src/server/api/endpoints/aggregation/hashtags.ts +++ b/src/server/api/endpoints/aggregation/hashtags.ts @@ -29,22 +29,22 @@ export default define(meta, (ps) => new Promise(async (res, rej) => { $group: { _id: { tag: '$tagsLower', userId: '$userId' } } - }]) as Array<{ + }]) as { _id: { tag: string; userId: any; } - }>; + }[]; //#endregion if (data.length == 0) { return res([]); } - let tags: Array<{ + let tags: { name: string; count: number; - }> = []; + }[] = []; // カウント for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) { diff --git a/src/server/api/endpoints/hashtags/trend.ts b/src/server/api/endpoints/hashtags/trend.ts index a26dbf0941..d4efe5d910 100644 --- a/src/server/api/endpoints/hashtags/trend.ts +++ b/src/server/api/endpoints/hashtags/trend.ts @@ -40,22 +40,22 @@ export default define(meta, () => new Promise(async (res, rej) => { $group: { _id: { tag: '$tagsLower', userId: '$userId' } } - }]) as Array<{ + }]) as { _id: { tag: string; userId: any; } - }>; + }[]; //#endregion if (data.length == 0) { return res([]); } - const tags: Array<{ + const tags: { name: string; count: number; - }> = []; + }[] = []; // カウント for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) { @@ -108,7 +108,7 @@ export default define(meta, () => new Promise(async (res, rej) => { //#endregion //#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する - const countPromises: Array<Promise<any[]>> = []; + const countPromises: Promise<any[]>[] = []; const range = 20; diff --git a/src/server/api/stream/channels/hashtag.ts b/src/server/api/stream/channels/hashtag.ts index c8b6c578de..586ce02f06 100644 --- a/src/server/api/stream/channels/hashtag.ts +++ b/src/server/api/stream/channels/hashtag.ts @@ -14,7 +14,7 @@ export default class extends Channel { const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null; const mutedUserIds = mute ? mute.map(m => m.muteeId.toString()) : []; - const q: Array<string[]> = params.q; + const q: string[][] = params.q; if (q == null) return; |