Fix: Volunteer card: Add tick box in EFZ documents #272#351
Fix: Volunteer card: Add tick box in EFZ documents #272#351need4deed merged 3 commits intoneed4deed-org:developfrom
Conversation
There was a problem hiding this comment.
The receivedState is stored in local useState only — no API call is made when the checkbox is toggled. This means the received status is lost on every page refresh and the BE is never updated.
// VolunteerProfileDocument.tsx
const [receivedState, setReceivedState] = useState<Record<string, { isReceived: boolean; receivedAt: Date | null }>>({});
const handleToggleReceived = (type: string) => {
setReceivedState((prev) => { ... }); // local state only, no mutation
};To make this work properly, onToggleReceived needs to call a mutation that persists the received status to the BE (similar to how uploadMutation and deleteMutation are handled). it need to be added to the BE first
|
The backend doesn't support this yet, there's no endpoint or SDK field for marking documents as received. The local state is intentional as a placeholder until the backend implements it, at which point the mutation can be wired up following the same pattern as |
|
Updated |
|
Before this gets merged, please run |
|
BE PR need4deed-org/be#417 adds the endpoint and migration. SDK changes are being published locally. Once the new SDK version is available, please update this PR:
SDK types to use:
|
Fix: Volunteer card: Add tick box in EFZ documents need4deed-org#272
Fix: no API call is made
…om API response Update: Fix: wire received checkbox to API mutation and read state from API response
94d4ad5 to
6e417d6
Compare
|
Updated |
nadavosa
left a comment
There was a problem hiding this comment.
Mutation wired up correctly — useMarkDocumentReceived called on toggle, receivedAt date shown, badge reflects received state. The checkbox now actually persists.
Merge is contingent on BE PR need4deed-org/be#417 being merged first (which adds the received/receivedOn fields to the API).
Fix: Volunteer card: Add tick box in EFZ documents #272
Description
Added Received checkbox column to the left of the Status column in the document table
Related Issues
Closes #272
Changes
receivedandreceivedOntranslation keys (EN + DE)Screenshots / Demos
Checklist