mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 14:36:31 +00:00
fix(shared): align todo contracts with the wire format the client sends
The optional metadata fields (category, due_date, description, assigned_user_id — plus priority on update) now accept explicit null: the client clears fields by sending null, which the schemas rejected. checked accepts the legacy 0/1 numeric form alongside boolean (the integration net pins it). Drops the client-side casts that papered over the too-narrow types.
This commit is contained in:
@@ -350,7 +350,7 @@ function DetailPane({ item, tripId, categories, members, onClose }: {
|
||||
name: name.trim(), description: desc || null,
|
||||
due_date: dueDate || null, category: category || null,
|
||||
assigned_user_id: assignedUserId, priority,
|
||||
} as any)
|
||||
})
|
||||
} catch (err: unknown) { toast.error(err instanceof Error ? err.message : t('common.error')) }
|
||||
setSaving(false)
|
||||
}
|
||||
@@ -566,7 +566,7 @@ function NewTaskPane({ tripId, categories, members, defaultCategory, onCreated,
|
||||
name: name.trim(), description: desc || null, priority,
|
||||
due_date: dueDate || null, category: trimmedCategory || null,
|
||||
assigned_user_id: assignedUserId,
|
||||
} as any)
|
||||
})
|
||||
if (item?.id) onCreated(item.id)
|
||||
} catch (err: unknown) { toast.error(err instanceof Error ? err.message : t('common.error')) }
|
||||
setSaving(false)
|
||||
|
||||
Reference in New Issue
Block a user