(userId: string, organizationId: string)
| 22 | import { createTRPCRouter, protectedProcedure } from '../trpc'; |
| 23 | |
| 24 | async function requireAdmin(userId: string, organizationId: string) { |
| 25 | const access = await getOrganizationAccess({ userId, organizationId }); |
| 26 | if (access?.role !== 'org:admin') { |
| 27 | throw new TRPCForbiddenError('Only organization admins can manage billing'); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | export const subscriptionRouter = createTRPCRouter({ |
| 32 | getCurrent: protectedProcedure |