fix(lists): pass nextCompleted argument to api.toggleListItem and make parameter optional
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m7s

This commit is contained in:
sandrodach committed 2026-10-24 23:30:45 +02:00
1 parent b3e651b3b9
commit 2504b48171
3 files changed
+2746 -2

No files matched your search

+2744
View File
File diff suppressed because it is too large. Load diff
@@ -179,7 +179,7 @@ export const SharedListsView: React.FC<SharedListsViewProps> = ({ onRefreshGloba
}) })
); );
await api.toggleListItem(activeList.id, item.id); await api.toggleListItem(activeList.id, item.id, nextCompleted);
onRefreshGlobal(); onRefreshGlobal();
}; };
+1 -1
View File
@@ -487,7 +487,7 @@ export const api = {
}); });
}, },
async toggleListItem(listId: string, itemId: string, isCompleted: boolean): Promise<ListItem> { async toggleListItem(listId: string, itemId: string, isCompleted?: boolean): Promise<ListItem> {
return request<ListItem>(`/api/v1/lists/${listId}/items/${itemId}`, { return request<ListItem>(`/api/v1/lists/${listId}/items/${itemId}`, {
method: 'PATCH', method: 'PATCH',
body: JSON.stringify({ isCompleted }), body: JSON.stringify({ isCompleted }),