Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove "must be within" restriction

Steven Tey3906a28ee557
diff --git a/apps/web/lib/actions/partners/create-partner-comment.ts b/apps/web/lib/actions/partners/create-partner-comment.ts
index 38d74eac95..274f829891 100644
--- a/apps/web/lib/actions/partners/create-partner-comment.ts
+++ b/apps/web/lib/actions/partners/create-partner-comment.ts
@@ -14,7 +14,7 @@ export const createPartnerCommentAction = authActionClient
.schema(createPartnerCommentSchema)
.action(async ({ parsedInput, ctx }) => {
const { workspace, user } = ctx;
- const { partnerId, text, createdAt } = parsedInput;
+ const { partnerId, text } = parsedInput;
const programId = getDefaultProgramIdOrThrow(workspace);
@@ -30,7 +30,6 @@ export const createPartnerCommentAction = authActionClient
partnerId,
userId: user.id,
text,
- createdAt,
},
include: {
user: true,
diff --git a/apps/web/lib/zod/schemas/messages.ts b/apps/web/lib/zod/schemas/messages.ts
index 53d871952b..e23971f0a8 100644
--- a/apps/web/lib/zod/schemas/messages.ts
+++ b/apps/web/lib/zod/schemas/messages.ts
@@ -83,14 +83,4 @@ export const getProgramMessagesQuerySchema = z.object({
export const messageProgramSchema = z.object({
programSlug: z.string(),
text: messageTextSchema.max(MAX_MESSAGE_LENGTH),
- createdAt: z.coerce
- .date()
- .refine(
- (date) =>
- date.getTime() <= Date.now() &&
- date.getTime() >= Date.now() - 1000 * 60,
- {
- message: "Message timestamp must be within the last 60 seconds",
- },
- ),
});
diff --git a/apps/web/lib/zod/schemas/programs.ts b/apps/web/lib/zod/schemas/programs.ts
index 206e72b18e..58bea5663d 100644
--- a/apps/web/lib/zod/schemas/programs.ts
+++ b/apps/web/lib/zod/schemas/programs.ts
@@ -194,16 +194,6 @@ export const createPartnerCommentSchema = z.object({
workspaceId: z.string(),
partnerId: z.string(),
text: z.string().min(1).max(MAX_PROGRAM_PARTNER_COMMENT_LENGTH),
- createdAt: z.coerce
- .date()
- .refine(
- (date) =>
- date.getTime() <= Date.now() &&
- date.getTime() >= Date.now() - 1000 * 60,
- {
- message: "Comment timestamp must be within the last 60 seconds",
- },
- ),
});
export const updatePartnerCommentSchema = z.object({