fix(api): add 404 guard when logo confirm returns no rows

The returning() on the update query can produce undefined when zero
rows match. Added explicit 404 if updated is falsy.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
groombook-engineer[bot]
2026-04-02 12:44:14 +00:00
parent 71a6623da2
commit 28ed09b33d
+4
View File
@@ -132,6 +132,10 @@ settingsRouter.post(
.where(eq(businessSettings.id, settingsId))
.returning();
if (!updated) {
return c.json({ error: "Settings not found" }, 404);
}
return c.json({ ok: true, logoKey: updated.logoKey });
}
);