mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 04:31:39 +10:00
19 lines
514 B
TypeScript
19 lines
514 B
TypeScript
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,
|
|
});
|
|
});
|