feat(captura): fechas de Obra bloqueadas tras establecerse, solo admin las cambia

This commit is contained in:
2026-09-12 07:52:40 +00:00
parent 1c81331614
commit d2e97f33f5
8 changed files with 175 additions and 10 deletions

View File

@@ -161,7 +161,10 @@ export async function guardarCampo(data: {
}),
)
manejar401(resp)
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
if (!resp.ok) {
const cuerpo = (await resp.json().catch(() => null)) as { error?: string } | null
throw new Error(cuerpo?.error ?? `HTTP ${resp.status}`)
}
}
/** POST /api/captura/bulk — guardar múltiples campos */
@@ -183,5 +186,8 @@ export async function guardarBulk(data: {
}),
)
manejar401(resp)
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
if (!resp.ok) {
const cuerpo = (await resp.json().catch(() => null)) as { error?: string } | null
throw new Error(cuerpo?.error ?? `HTTP ${resp.status}`)
}
}