mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 21:22:15 +01:00
fix package build error dependencies
This commit is contained in:
@@ -81,7 +81,7 @@ export const useNotificationsStore = defineStore('notifications', () => {
|
||||
}
|
||||
return response;
|
||||
} catch {
|
||||
router.get(route('login'));
|
||||
router.get('/login');
|
||||
}
|
||||
} else {
|
||||
addNotification('error', 'The action failed. Please try again later.');
|
||||
|
||||
@@ -1,19 +1,36 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { getCurrentMembershipId, getCurrentOrganizationId } from '@/utils/useUser';
|
||||
|
||||
import { reactive, ref } from 'vue';
|
||||
import {
|
||||
api,
|
||||
type CreateTimeEntryBody,
|
||||
type TimeEntriesQueryParams,
|
||||
type TimeEntry,
|
||||
import { reactive, ref, type Ref } from 'vue';
|
||||
import { api } from '@/packages/api/src';
|
||||
import type {
|
||||
CreateTimeEntryBody,
|
||||
TimeEntriesQueryParams,
|
||||
TimeEntry,
|
||||
UpdateMultipleTimeEntriesChangeset,
|
||||
} from '@/packages/api/src';
|
||||
import dayjs from 'dayjs';
|
||||
import { useNotificationsStore } from '@/utils/notification';
|
||||
import type { UpdateMultipleTimeEntriesChangeset } from '@/packages/api/src';
|
||||
import type {} from '@/packages/api/src';
|
||||
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 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();
|
||||
if (organizationId) {
|
||||
await handleApiRequestNotifications(
|
||||
@@ -222,4 +242,5 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
|
||||
deleteTimeEntries,
|
||||
patchTimeEntries,
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user