This commit is contained in:
Timo Knuth
2026-02-27 15:19:24 +01:00
parent b7f8221095
commit 253c3c1c6d
134 changed files with 11188 additions and 1871 deletions

View File

@@ -43,6 +43,7 @@ export const protectedProcedure = t.procedure.use(({ ctx, next }) => {
export const memberProcedure = protectedProcedure.use(async ({ ctx, next }) => {
const userRole = await ctx.prisma.userRole.findFirst({
where: { userId: ctx.session.user.id },
orderBy: { createdAt: 'asc' },
})
if (!userRole) {
throw new TRPCError({
@@ -65,6 +66,7 @@ export const memberProcedure = protectedProcedure.use(async ({ ctx, next }) => {
export const adminProcedure = protectedProcedure.use(async ({ ctx, next }) => {
const userRole = await ctx.prisma.userRole.findFirst({
where: { userId: ctx.session.user.id, role: 'admin' },
orderBy: { createdAt: 'asc' },
})
if (!userRole) {
throw new TRPCError({