Return 200+null instead of 404 when no cash up found for date — eliminates browser console error
This commit is contained in:
parent
ed9cce1d76
commit
37453ddfda
2 changed files with 6 additions and 6 deletions
|
|
@ -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([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue