feat: fix predictions

This commit is contained in:
Nevo David 2024-03-13 16:56:38 +07:00
parent d230e10870
commit 4100fdfeb7
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export class AnalyticsController {
@Get('/trending')
async getTrending() {
const stars = await this._starsService.predictTrending(10);
const findFirst = stars.find(star => dayjs(star).isBefore(dayjs()));
const findFirst = stars.find(star => dayjs(star).isAfter(dayjs()));
const trendings = (await this._starsService.getTrending('')).reverse();
const dates = trendings.map(result => dayjs(result.date).toDate());
const lastTrendingDate = dates[dates.length - 1];