Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: fix predictions

Nevo David4100fdfeb703
diff --git a/apps/backend/src/api/routes/analytics.controller.ts b/apps/backend/src/api/routes/analytics.controller.ts
index c1f3aee93..a95a32a51 100644
--- a/apps/backend/src/api/routes/analytics.controller.ts
+++ b/apps/backend/src/api/routes/analytics.controller.ts
@@ -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];