Add edit and delete to task modal

Edit button (update cap): inline form for title, description, priority, unusable flag, due date. Delete button (admin only): hard delete with confirm step, cascades photos/events and cleans files from disk. Backend adds DELETE /api/tasks/:id route.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-22 10:17:57 +00:00
parent 03d1cd2bb6
commit ca006f9aea
3 changed files with 118 additions and 5 deletions

View file

@ -75,6 +75,9 @@ export function createTask(body: Record<string, unknown>): Promise<Task> {
export function updateTask(id: number, body: Record<string, unknown>): Promise<Task> {
return request(`/tasks/${id}`, { method: 'PATCH', body: JSON.stringify(body) })
}
export function deleteTask(id: number): Promise<{ ok: boolean }> {
return request(`/tasks/${id}`, { method: 'DELETE' })
}
export function resolveTask(id: number, body: {
status: 'temporary_fix' | 'fixed'
completed_by?: string