The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update messages.ts
Kiran Kb4d46fc95bd3
diff --git a/apps/web/lib/zod/schemas/messages.ts b/apps/web/lib/zod/schemas/messages.tsindex 5ce9f6c5ea..79cc2ce947 100644--- a/apps/web/lib/zod/schemas/messages.ts+++ b/apps/web/lib/zod/schemas/messages.ts@@ -1,12 +1,16 @@+import { MessageType } from "@prisma/client";import { z } from "zod";import { PartnerSchema } from "./partners";import { ProgramSchema } from "./programs";import { UserSchema } from "./users";-import { MessageType } from "@prisma/client";export const MAX_MESSAGE_LENGTH = 2000;-const messageTextSchema = z.string().min(1).max(MAX_MESSAGE_LENGTH);+const messageTextSchema = z+ .string()+ .min(1)+ .max(MAX_MESSAGE_LENGTH)+ .transform((v) => v.replace(/<[^>]+>/g, "").trim());export const MessageSchema = z.object({id: z.string(),