creates application

This commit is contained in:
simon.franken
2026-02-16 10:15:27 +01:00
parent 791c661395
commit 7d678c1c4d
65 changed files with 10389 additions and 0 deletions

30
frontend/src/api/timer.ts Normal file
View File

@@ -0,0 +1,30 @@
import apiClient from './client';
import type { OngoingTimer, TimeEntry } from '@/types';
export const timerApi = {
getOngoing: async (): Promise<OngoingTimer | null> => {
const { data } = await apiClient.get<OngoingTimer | null>('/timer');
return data;
},
start: async (projectId?: string): Promise<OngoingTimer> => {
const { data } = await apiClient.post<OngoingTimer>('/timer/start', {
projectId,
});
return data;
},
update: async (projectId?: string | null): Promise<OngoingTimer> => {
const { data } = await apiClient.put<OngoingTimer>('/timer', {
projectId,
});
return data;
},
stop: async (projectId?: string): Promise<TimeEntry> => {
const { data } = await apiClient.post<TimeEntry>('/timer/stop', {
projectId,
});
return data;
},
};