The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Message updates
Tim Wilson7bcf41b78f12
diff --git a/apps/web/lib/zod/schemas/messages.ts b/apps/web/lib/zod/schemas/messages.tsindex a2283546aa..d9c46ce579 100644--- a/apps/web/lib/zod/schemas/messages.ts+++ b/apps/web/lib/zod/schemas/messages.ts@@ -2,6 +2,8 @@ import { z } from "zod";import { PartnerSchema } from "./partners";import { UserSchema } from "./users";+export const MAX_MESSAGE_LENGTH = 2000;+export const MessageSchema = z.object({id: z.string(),@@ -10,7 +12,7 @@ export const MessageSchema = zsenderPartnerId: z.string().nullable(),senderUserId: z.string().nullable(),- text: z.string(),+ text: z.string().min(1).max(MAX_MESSAGE_LENGTH),emailId: z.string().nullable(),readInApp: z.date().nullable(),diff --git a/apps/web/ui/messages/messages-panel.tsx b/apps/web/ui/messages/messages-panel.tsxindex de60840c05..829cb02654 100644--- a/apps/web/ui/messages/messages-panel.tsx+++ b/apps/web/ui/messages/messages-panel.tsx@@ -1,4 +1,5 @@import { Message } from "@/lib/types";+import { MAX_MESSAGE_LENGTH } from "@/lib/zod/schemas/messages";import {ArrowTurnLeft,Button,@@ -201,6 +202,7 @@ export function MessagesPanel({placeholder={placeholder}disabled={!messages}value={typedMessage}+ maxLength={MAX_MESSAGE_LENGTH}onChange={(e) => setTypedMessage(e.currentTarget.value)}onKeyDown={(e) => {if (e.key === "Enter" && !e.shiftKey) {diff --git a/packages/prisma/schema/message.prisma b/packages/prisma/schema/message.prismaindex bf853a1293..a43de7d1dd 100644--- a/packages/prisma/schema/message.prisma+++ b/packages/prisma/schema/message.prisma@@ -7,7 +7,7 @@ model Message {senderPartnerId String? // Populated if the sender is a partnersenderUserId String? // Populated if the sender is a program owner/user- text String+ text String @db.TextemailId String?readInApp DateTime?