mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 05:02:14 +01:00
fix error handling for 404 error in active time entry
This commit is contained in:
@@ -57,13 +57,17 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => {
|
|||||||
async function fetchCurrentTimeEntry() {
|
async function fetchCurrentTimeEntry() {
|
||||||
const organizationId = getCurrentOrganizationId();
|
const organizationId = getCurrentOrganizationId();
|
||||||
if (organizationId) {
|
if (organizationId) {
|
||||||
const timeEntriesResponse = await api.getMyActiveTimeEntry({});
|
try {
|
||||||
if (timeEntriesResponse?.data) {
|
const timeEntriesResponse = await api.getMyActiveTimeEntry({});
|
||||||
if (timeEntriesResponse.data) {
|
if (timeEntriesResponse?.data) {
|
||||||
currentTimeEntry.value = timeEntriesResponse.data;
|
if (timeEntriesResponse.data) {
|
||||||
} else {
|
currentTimeEntry.value = timeEntriesResponse.data;
|
||||||
currentTimeEntry.value = { ...emptyTimeEntry };
|
} else {
|
||||||
|
currentTimeEntry.value = { ...emptyTimeEntry };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
currentTimeEntry.value = { ...emptyTimeEntry };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in New Issue
Block a user