Files
cal.diy/packages/trpc/server/routers/viewer/teams/update.schema.ts
T
Alex van Andel c08365f09c feat: Implement orgs/teams logoUrls (#13699)
* feat: Implement orgs/teams logoUrls

* Use getAvatarUrl in team/[slug]

* Extract uploadLogo to standalone file for reuse

* Allow removing the team/organisation logo

* fix: API build fail due to server-only, removed
2024-02-16 10:35:53 -03:00

28 lines
790 B
TypeScript

import { z } from "zod";
import { resizeBase64Image } from "@calcom/lib/server/resizeBase64Image";
import slugify from "@calcom/lib/slugify";
export const ZUpdateInputSchema = z.object({
id: z.number(),
bio: z.string().optional(),
name: z.string().optional(),
logo: z
.string()
.transform(async (val) => await resizeBase64Image(val))
.nullable()
.optional(),
slug: z
.string()
.transform((val) => slugify(val.trim()))
.optional(),
hideBranding: z.boolean().optional(),
hideBookATeamMember: z.boolean().optional(),
isPrivate: z.boolean().optional(),
brandColor: z.string().optional(),
darkBrandColor: z.string().optional(),
theme: z.string().optional().nullable(),
});
export type TUpdateInputSchema = z.infer<typeof ZUpdateInputSchema>;