mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-24 19:58:04 +02:00
✨ New and Improved Screens (#1151)
This commit is contained in:
parent
5461c57228
commit
997a1eec78
75 changed files with 1517 additions and 743 deletions
17
packages/backend/trpc/routers/dashboard.ts
Normal file
17
packages/backend/trpc/routers/dashboard.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { prisma } from "@rallly/database";
|
||||
|
||||
import { possiblyPublicProcedure, router } from "../trpc";
|
||||
|
||||
export const dashboard = router({
|
||||
info: possiblyPublicProcedure.query(async ({ ctx }) => {
|
||||
const activePollCount = await prisma.poll.count({
|
||||
where: {
|
||||
userId: ctx.user.id,
|
||||
status: "live",
|
||||
deleted: false, // TODO (Luke Vella) [2024-06-16]: We should add deleted/cancelled to the status enum
|
||||
},
|
||||
});
|
||||
|
||||
return { activePollCount };
|
||||
}),
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue