fix: refactor api routes

This commit is contained in:
David Nguyen
2024-12-30 21:01:03 +11:00
parent df33fbf91b
commit 22665543c0
100 changed files with 2268 additions and 2303 deletions

View File

@ -0,0 +1,32 @@
import { z } from 'zod';
import { updateTeam } from '@documenso/lib/server-only/team/update-team';
import { authenticatedProcedure } from '../trpc';
import { ZTeamNameSchema, ZTeamUrlSchema } from './schema';
export const ZUpdateTeamRequestSchema = z.object({
teamId: z.number(),
data: z.object({
name: ZTeamNameSchema,
url: ZTeamUrlSchema,
}),
});
export const updateTeamRoute = authenticatedProcedure
// .meta({
// openapi: {
// method: 'POST',
// path: '/team/{teamId}',
// summary: 'Update team',
// tags: ['Teams'],
// },
// })
.input(ZUpdateTeamRequestSchema)
.output(z.unknown())
.mutation(async ({ input, ctx }) => {
return await updateTeam({
userId: ctx.user.id,
...input,
});
});