mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 13:12:16 +01:00
add partial patches to time entries store after time entry updates to avoid inconsistencies , fixes ST-259
This commit is contained in:
@@ -78,7 +78,7 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
|||||||
async function updateTimeEntry(timeEntry: TimeEntry) {
|
async function updateTimeEntry(timeEntry: TimeEntry) {
|
||||||
const organizationId = getCurrentOrganizationId();
|
const organizationId = getCurrentOrganizationId();
|
||||||
if (organizationId) {
|
if (organizationId) {
|
||||||
await handleApiRequestNotifications(
|
const response = await handleApiRequestNotifications(
|
||||||
() =>
|
() =>
|
||||||
api.updateTimeEntry(timeEntry, {
|
api.updateTimeEntry(timeEntry, {
|
||||||
params: {
|
params: {
|
||||||
@@ -89,6 +89,9 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
|||||||
'Time entry updated successfully',
|
'Time entry updated successfully',
|
||||||
'Failed to update time entry'
|
'Failed to update time entry'
|
||||||
);
|
);
|
||||||
|
timeEntries.value = timeEntries.value.map((entry) =>
|
||||||
|
entry.id === timeEntry.id ? response.data : entry
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user