mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 12:41:36 +10:00
fix: refactor api routes
This commit is contained in:
30
packages/trpc/server/team-router/update-team-email-route.ts
Normal file
30
packages/trpc/server/team-router/update-team-email-route.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { updateTeamEmail } from '@documenso/lib/server-only/team/update-team-email';
|
||||
|
||||
import { authenticatedProcedure } from '../trpc';
|
||||
|
||||
export const ZUpdateTeamEmailRequestSchema = z.object({
|
||||
teamId: z.number(),
|
||||
data: z.object({
|
||||
name: z.string().trim().min(1),
|
||||
}),
|
||||
});
|
||||
|
||||
export const updateTeamEmailRequestRoute = authenticatedProcedure
|
||||
// .meta({
|
||||
// openapi: {
|
||||
// method: 'POST',
|
||||
// path: '/team/{teamId}/email',
|
||||
// summary: 'Update a team email',
|
||||
// description: '',
|
||||
// tags: ['Teams'],
|
||||
// },
|
||||
// })
|
||||
.input(ZUpdateTeamEmailRequestSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
return await updateTeamEmail({
|
||||
userId: ctx.user.id,
|
||||
...input,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user