const userAcounts = await db
.select({
amount: sql<number>`sum(${accounts.amount})`,
date: accounts.date,
type: accounts.type,
})
.from(accounts)
.where(and(eq(accounts.userId, user?.id!), eq(accounts.date, new Date())))
.groupBy(accounts.date, accounts.type)
.orderBy(desc(accounts.date));
const userAcounts = await db
.select({
amount: sql<number>`sum(${accounts.amount})`,
date: accounts.date,
type: accounts.type,
})
.from(accounts)
.where(and(eq(accounts.userId, user?.id!), eq(accounts.date, new Date())))
.groupBy(accounts.date, accounts.type)
.orderBy(desc(accounts.date));