Skip to content

Commit

Permalink
fix: daily Count api
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Dec 11, 2024
1 parent 056db37 commit 3f7d461
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/tx/tx.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ export class TxService {
}

async getDailyTransactions(): Promise<number> {
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
},
},
});
Expand Down

0 comments on commit 3f7d461

Please sign in to comment.