mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-19 05:32:16 +01:00
fix error handling for 404 error in active time entry
This commit is contained in:
@@ -57,6 +57,7 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => {
|
||||
async function fetchCurrentTimeEntry() {
|
||||
const organizationId = getCurrentOrganizationId();
|
||||
if (organizationId) {
|
||||
try {
|
||||
const timeEntriesResponse = await api.getMyActiveTimeEntry({});
|
||||
if (timeEntriesResponse?.data) {
|
||||
if (timeEntriesResponse.data) {
|
||||
@@ -65,6 +66,9 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => {
|
||||
currentTimeEntry.value = { ...emptyTimeEntry };
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
currentTimeEntry.value = { ...emptyTimeEntry };
|
||||
}
|
||||
} else {
|
||||
throw new Error(
|
||||
'Failed to fetch current time entry because organization ID is missing.'
|
||||
|
||||
Reference in New Issue
Block a user