Return 200+null instead of 404 when no cash up found for date — eliminates browser console error

This commit is contained in:
jtricerolph 2026-07-07 20:56:34 +00:00
parent ed9cce1d76
commit 37453ddfda
2 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ export async function cashupRoutes(app) {
const { rows } = await pool.query(
'SELECT * FROM cash_ups WHERE session_date = $1', [date]
)
if (!rows.length) return reply.status(404).send({ error: 'Not found' })
if (!rows.length) return { cash_up: null }
const cashUp = rows[0]
const [denoms, machines, recon, attachments] = await Promise.all([