mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 04:32:15 +01:00
fix package build error dependencies
This commit is contained in:
@@ -81,7 +81,7 @@ export const useNotificationsStore = defineStore('notifications', () => {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
} catch {
|
} catch {
|
||||||
router.get(route('login'));
|
router.get('/login');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addNotification('error', 'The action failed. Please try again later.');
|
addNotification('error', 'The action failed. Please try again later.');
|
||||||
|
|||||||
@@ -1,19 +1,36 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { getCurrentMembershipId, getCurrentOrganizationId } from '@/utils/useUser';
|
import { getCurrentMembershipId, getCurrentOrganizationId } from '@/utils/useUser';
|
||||||
|
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, type Ref } from 'vue';
|
||||||
import {
|
import { api } from '@/packages/api/src';
|
||||||
api,
|
import type {
|
||||||
type CreateTimeEntryBody,
|
CreateTimeEntryBody,
|
||||||
type TimeEntriesQueryParams,
|
TimeEntriesQueryParams,
|
||||||
type TimeEntry,
|
TimeEntry,
|
||||||
|
UpdateMultipleTimeEntriesChangeset,
|
||||||
} from '@/packages/api/src';
|
} from '@/packages/api/src';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useNotificationsStore } from '@/utils/notification';
|
import { useNotificationsStore } from '@/utils/notification';
|
||||||
import type { UpdateMultipleTimeEntriesChangeset } from '@/packages/api/src';
|
import type {} from '@/packages/api/src';
|
||||||
import { useQueryClient } from '@tanstack/vue-query';
|
import { useQueryClient } from '@tanstack/vue-query';
|
||||||
|
|
||||||
export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
export const useTimeEntriesStore = defineStore(
|
||||||
|
'timeEntries',
|
||||||
|
(): {
|
||||||
|
timeEntries: Ref<TimeEntry[]>;
|
||||||
|
fetchTimeEntries: (queryParams?: TimeEntriesQueryParams) => Promise<void>;
|
||||||
|
updateTimeEntry: (timeEntry: TimeEntry) => Promise<void>;
|
||||||
|
createTimeEntry: (timeEntry: Omit<CreateTimeEntryBody, 'member_id'>) => Promise<void>;
|
||||||
|
deleteTimeEntry: (timeEntryId: string) => Promise<void>;
|
||||||
|
fetchMoreTimeEntries: () => Promise<void>;
|
||||||
|
allTimeEntriesLoaded: Ref<boolean>;
|
||||||
|
updateTimeEntries: (
|
||||||
|
ids: string[],
|
||||||
|
changes: UpdateMultipleTimeEntriesChangeset
|
||||||
|
) => Promise<void>;
|
||||||
|
deleteTimeEntries: (timeEntries: TimeEntry[]) => Promise<void>;
|
||||||
|
patchTimeEntries: (queryParams?: TimeEntriesQueryParams) => Promise<void>;
|
||||||
|
} => {
|
||||||
const timeEntries = ref<TimeEntry[]>(reactive([]));
|
const timeEntries = ref<TimeEntry[]>(reactive([]));
|
||||||
|
|
||||||
const allTimeEntriesLoaded = ref(false);
|
const allTimeEntriesLoaded = ref(false);
|
||||||
@@ -106,7 +123,10 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateTimeEntries(ids: string[], changes: UpdateMultipleTimeEntriesChangeset) {
|
async function updateTimeEntries(
|
||||||
|
ids: string[],
|
||||||
|
changes: UpdateMultipleTimeEntriesChangeset
|
||||||
|
) {
|
||||||
const organizationId = getCurrentOrganizationId();
|
const organizationId = getCurrentOrganizationId();
|
||||||
if (organizationId) {
|
if (organizationId) {
|
||||||
await handleApiRequestNotifications(
|
await handleApiRequestNotifications(
|
||||||
@@ -222,4 +242,5 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
|||||||
deleteTimeEntries,
|
deleteTimeEntries,
|
||||||
patchTimeEntries,
|
patchTimeEntries,
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user