Skip to content

Commit

Permalink
add organization_id to optimistic TimeEntry, fixes ST-420
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Oct 22, 2024
1 parent 63579f8 commit 318af9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renderer/src/utils/timeEntries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,13 @@ export function useTimeEntryCreateMutation() {
},
onMutate: async (variables) => {
await queryClient.cancelQueries({ queryKey: ['currentTimeEntry'] })
const optimisticTimeEntry = { data: { ...variables, id: self.crypto.randomUUID() } }
const optimisticTimeEntry = {
data: {
...variables,
organization_id: currentOrganizationId.value,
id: self.crypto.randomUUID(),
},
}
queryClient.setQueryData(['currentTimeEntry'], () => optimisticTimeEntry)
return { optimisticTimeEntry }
},
Expand Down

0 comments on commit 318af9c

Please sign in to comment.