From 6a30d32e7d7aced5138ce64ca93103649c387c20 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 7 Apr 2019 23:31:58 +0900 Subject: [PATCH] Fix bug --- src/client/app/common/views/components/trends.vue | 4 ++-- src/server/api/endpoints/hashtags/trend.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/app/common/views/components/trends.vue b/src/client/app/common/views/components/trends.vue index cd67cc0092..536d55247c 100644 --- a/src/client/app/common/views/components/trends.vue +++ b/src/client/app/common/views/components/trends.vue @@ -4,9 +4,9 @@

{{ $t('empty') }}

-
+
- #{{ stat.name }} + #{{ stat.tag }}

{{ $t('count').replace('{}', stat.usersCount) }}

diff --git a/src/server/api/endpoints/hashtags/trend.ts b/src/server/api/endpoints/hashtags/trend.ts index c750e72a15..e01e9d698f 100644 --- a/src/server/api/endpoints/hashtags/trend.ts +++ b/src/server/api/endpoints/hashtags/trend.ts @@ -67,7 +67,7 @@ export default define(meta, async () => { .slice(0, max); //#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する - const countPromises: Promise[] = []; + const countPromises: Promise[] = []; const range = 20; @@ -87,7 +87,7 @@ export default define(meta, async () => { const countsLog = await Promise.all(countPromises); - const totalCounts: any = await Promise.all(hots.map(tag => Notes.createQueryBuilder('note') + const totalCounts = await Promise.all(hots.map(tag => Notes.createQueryBuilder('note') .select('count(distinct note.userId)') .where(':tag = ANY(note.tags)', { tag: tag }) .andWhere('note.createdAt > :gt', { gt: new Date(Date.now() - (interval * range)) }) @@ -98,8 +98,8 @@ export default define(meta, async () => { const stats = hots.map((tag, i) => ({ tag, - chart: countsLog.map(counts => counts[i].length), - usersCount: totalCounts[i].length + chart: countsLog.map(counts => counts[i]), + usersCount: totalCounts[i] })); return stats;