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
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m7s
This commit is contained in:
1 parent
b3e651b3b9
commit
2504b48171
3 files changed
+2746
-2
No files matched your search
Generated
+2744
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();
|
||||
};
|
||||
|
||||
|
||||
@@ -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}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify({ isCompleted }),
|
||||
|
||||
Reference in new issue
Block a user