add mass updates to time entry aggregate rows, make package actions run on manual dispatch

This commit is contained in:
Gregor Vostrak
2024-08-22 19:14:56 +02:00
parent 0c05ad240d
commit 33d139e3aa
6 changed files with 48 additions and 31 deletions

View File

@@ -77,6 +77,31 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
}
}
async function updateTimeEntries(
ids: string[],
changes: Partial<TimeEntry>
) {
const organizationId = getCurrentOrganizationId();
if (organizationId) {
await handleApiRequestNotifications(
() =>
api.updateMultipleTimeEntries(
{
ids: ids,
changes: changes,
},
{
params: {
organization: organizationId,
},
}
),
'Time entries updated successfully',
'Failed to update time entries'
);
}
}
async function updateTimeEntry(timeEntry: TimeEntry) {
const organizationId = getCurrentOrganizationId();
if (organizationId) {
@@ -147,5 +172,6 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
deleteTimeEntry,
fetchMoreTimeEntries,
allTimeEntriesLoaded,
updateTimeEntries,
};
});