import { apiFetch } from "../helpers/fetcher";

const BASE_URL = 'dossierProjets';

const API_URL = `http://localhost:5000/${BASE_URL}`;

export async function createDossierProjet(id_dossier: string, data: any) {
    const dataResult = await apiFetch(`${API_URL}/${id_dossier}/create`, {
        method: "POST",
        body: JSON.stringify(data)
    });
    return dataResult;
}

export async function updateDossierProjet(id_dossier: string, data: any) {
    const result = await apiFetch(`${API_URL}/${id_dossier}/update`, {
        method: "PATCH",
        body: JSON.stringify(data)
    });
    return result;
}

export async function getDossierProjets(id_dossier: string) {
    const dataResult = await apiFetch(`${API_URL}/${id_dossier}`);
    return dataResult;
}