Fix initial load breaking.

This commit is contained in:
2025-12-13 15:26:56 -05:00
parent a1fc19b202
commit 58e3fb73b1
5 changed files with 22 additions and 15 deletions

View File

@@ -33,15 +33,20 @@ export const resolvers = {
}),
getStatsRange: async (
_parent: unknown,
data: { startDate: Date; endDate: Date }
data: { startDate: string; endDate: string }
// _ctx: unknown
) => {
const { startDate, endDate } = data;
if (startDate === "" || endDate === "") {
return null;
}
return await prisma.dailyStats.findMany({
where: {
createdAt: {
gt: startDate,
lte: endDate
gt: new Date(startDate),
lte: new Date(endDate)
}
},
orderBy: {