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

View File

@@ -0,0 +1,25 @@
import apiClient from './client';
import type { Project, CreateProjectInput, UpdateProjectInput } from '@/types';
export const projectsApi = {
getAll: async (clientId?: string): Promise<Project[]> => {
const { data } = await apiClient.get<Project[]>('/projects', {
params: clientId ? { clientId } : undefined,
});
return data;
},
create: async (input: CreateProjectInput): Promise<Project> => {
const { data } = await apiClient.post<Project>('/projects', input);
return data;
},
update: async (id: string, input: UpdateProjectInput): Promise<Project> => {
const { data } = await apiClient.put<Project>(`/projects/${id}`, input);
return data;
},
delete: async (id: string): Promise<void> => {
await apiClient.delete(`/projects/${id}`);
},
};