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,27 @@
import { z } from 'zod';
import { updateTeamBrandingSettings } from '@documenso/lib/server-only/team/update-team-branding-settings';
import { authenticatedProcedure } from '../trpc';
export const ZUpdateTeamBrandingSettingsRequestSchema = z.object({
teamId: z.number(),
settings: z.object({
brandingEnabled: z.boolean().optional().default(false),
brandingLogo: z.string().optional().default(''),
brandingUrl: z.string().optional().default(''),
brandingCompanyDetails: z.string().optional().default(''),
}),
});
export const updateTeamBrandingSettingsRoute = authenticatedProcedure
.input(ZUpdateTeamBrandingSettingsRequestSchema)
.mutation(async ({ ctx, input }) => {
const { teamId, settings } = input;
return await updateTeamBrandingSettings({
userId: ctx.user.id,
teamId,
settings,
});
});