From e08891c94b90990d85aa1ef3df9d8941d3e1a295 Mon Sep 17 00:00:00 2001 From: makearmy Date: Mon, 22 Sep 2025 15:34:20 -0400 Subject: [PATCH] submission date time fix --- app/api/submit/settings/route.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/api/submit/settings/route.ts b/app/api/submit/settings/route.ts index 049fe518..93ff6b4d 100644 --- a/app/api/submit/settings/route.ts +++ b/app/api/submit/settings/route.ts @@ -175,17 +175,21 @@ export async function POST(req: Request) { screen_id = up.id; } - // Repeaters + // Repeaters (pass through; UI already coerces numbers/bools) const fills = Array.isArray(body?.fill_settings) ? body.fill_settings : []; const lines = Array.isArray(body?.line_settings) ? body.line_settings : []; const rasters = Array.isArray(body?.raster_settings) ? body.raster_settings : []; - // (numbers coerced in your UI; keep as-is here) + // timestamps for required fields + const nowIso = new Date().toISOString(); + const payload: Record = { setting_title, uploader, setting_notes, - submission_date: new Date().toISOString(), + + submission_date: nowIso, // required by your schema + last_modified_date: nowIso, // ← add this to satisfy required rule photo: photo_id, screen: screen_id ?? null, @@ -205,7 +209,7 @@ export async function POST(req: Request) { status: "pending", submitted_via: "makearmy-app", - submitted_at: new Date().toISOString(), + submitted_at: nowIso, }; if (target === "settings_fiber") {