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,19 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { createTeamPendingCheckoutSession } from '@documenso/lib/server-only/team/create-team-checkout-session';
|
||||
|
||||
import { authenticatedProcedure } from '../trpc';
|
||||
|
||||
export const ZCreateTeamPendingCheckoutRouteRequestSchema = z.object({
|
||||
interval: z.union([z.literal('monthly'), z.literal('yearly')]),
|
||||
pendingTeamId: z.number(),
|
||||
});
|
||||
|
||||
export const createTeamPendingCheckoutRoute = authenticatedProcedure
|
||||
.input(ZCreateTeamPendingCheckoutRouteRequestSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
return await createTeamPendingCheckoutSession({
|
||||
userId: ctx.user.id,
|
||||
...input,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user