Log Workforce departments error to aid debugging
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6742204546
commit
da657ab6c7
1 changed files with 4 additions and 1 deletions
|
|
@ -226,7 +226,10 @@ export async function adminRoutes(app) {
|
|||
app.get('/workforce/departments', async (request, reply) => {
|
||||
let depts
|
||||
try { depts = await getAllDepartments() }
|
||||
catch (err) { return reply.status(502).send({ error: `Workforce API error: ${err.message}` }) }
|
||||
catch (err) {
|
||||
request.log.error({ err }, 'Workforce departments fetch failed')
|
||||
return reply.status(502).send({ error: `Workforce API error: ${err.message}` })
|
||||
}
|
||||
|
||||
const { rows: mappings } = await pool.query('SELECT department_id, role_id FROM workforce_department_roles')
|
||||
const mappingMap = Object.fromEntries(mappings.map(m => [m.department_id, m.role_id]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue