add detailed reporting page

This commit is contained in:
Gregor Vostrak
2024-09-18 16:54:10 +02:00
parent 165391861a
commit 3ee7839ca9
13 changed files with 446 additions and 22 deletions

View File

@@ -8,6 +8,7 @@ import { reactive, ref } from 'vue';
import {
api,
type CreateTimeEntryBody,
type TimeEntriesQueryParams,
type TimeEntry,
} from '@/packages/api/src';
import dayjs from 'dayjs';
@@ -19,8 +20,14 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
const allTimeEntriesLoaded = ref(false);
const { handleApiRequestNotifications } = useNotificationsStore();
async function fetchTimeEntries() {
async function fetchTimeEntries(
queryParams: TimeEntriesQueryParams = {
only_full_dates: 'true',
member_id: getCurrentMembershipId(),
}
) {
const organizationId = getCurrentOrganizationId();
if (organizationId) {
const timeEntriesResponse = await handleApiRequestNotifications(
() =>
@@ -28,10 +35,7 @@ export const useTimeEntriesStore = defineStore('timeEntries', () => {
params: {
organization: organizationId,
},
queries: {
only_full_dates: 'true',
member_id: getCurrentMembershipId(),
},
queries: queryParams,
}),
undefined,
'Failed to fetch time entries'