mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 20:51:33 +10:00
fix: refactor api routes
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { createTeamBillingPortal } from '@documenso/lib/server-only/team/create-team-billing-portal';
|
||||
|
||||
import { authenticatedProcedure } from '../trpc';
|
||||
|
||||
export const ZCreateBillingPortalRequestSchema = z.object({
|
||||
teamId: z.number(),
|
||||
});
|
||||
|
||||
export const createBillingPortalRoute = authenticatedProcedure
|
||||
.input(ZCreateBillingPortalRequestSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
return await createTeamBillingPortal({
|
||||
userId: ctx.user.id,
|
||||
...input,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user