diff --git a/src/components/timesheet/TimeSheetTable.tsx b/src/components/timesheet/TimeSheetTable.tsx index f016cf9..b0be9db 100644 --- a/src/components/timesheet/TimeSheetTable.tsx +++ b/src/components/timesheet/TimeSheetTable.tsx @@ -55,19 +55,19 @@ export const TimeSheetTable = component$( updateTimeEntries(timeEntryObject); }); - const deleteHandler = $((entry: TimeEntry) => { - if (!entry.isUnsaved) { + const deleteHandler = $((entries: TimeEntry[]) => { + if (entries.findIndex((entry) => !entry.isUnsaved) !== -1) { deleteTimeEntriesRowModalState.isVisible = true; deleteTimeEntriesRowModalState.confirmLabel = t('ACTION_CONFIRM'); deleteTimeEntriesRowModalState.cancelLabel = t('ACTION_CANCEL'); deleteTimeEntriesRowModalState.onConfirm$ = $(() => { - deleteProjectEntries(entry); + entries.forEach((entry) => deleteProjectEntries(entry)); }); return; } - deleteProjectEntries(entry); + entries.forEach((entry) => deleteProjectEntries(entry)); }); useTask$(async ({ track }) => { @@ -288,7 +288,7 @@ export const TimeSheetTable = component$( - diff --git a/src/services/timeSheet.ts b/src/services/timeSheet.ts index 5238ee0..8210e6f 100644 --- a/src/services/timeSheet.ts +++ b/src/services/timeSheet.ts @@ -13,7 +13,7 @@ export const getTimeEntries = async (from: string, to: string): Promise => checkHttpResponseStatus(`time-entry/mine`, 200, 'DELETE', { ...entry, - task: entry.task.name, + project: entry.project.name, }); export const postTimeEntries = async (timeEntry: TimeEntryObject): Promise => {