From 3f7d4619c939200ef6473353c8a54b2ccf9a3f3c Mon Sep 17 00:00:00 2001 From: aman035 Date: Wed, 11 Dec 2024 12:37:30 +0530 Subject: [PATCH] fix: daily Count api --- src/modules/tx/tx.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/tx/tx.service.ts b/src/modules/tx/tx.service.ts index b49f427..293b715 100644 --- a/src/modules/tx/tx.service.ts +++ b/src/modules/tx/tx.service.ts @@ -258,13 +258,13 @@ export class TxService { } async getDailyTransactions(): Promise { - const todayStart = new Date(); - todayStart.setHours(0, 0, 0, 0); // Set time to midnight for today's start + const past24Hours = new Date(); + past24Hours.setHours(past24Hours.getHours() - 24); // Set time to 24 hours ago return this.prisma.transaction.count({ where: { ts: { - gte: todayStart.getTime(), + gte: past24Hours.getTime(), // Use timestamp from 24 hours ago }, }, });