import { T_projects } from '@/types/projects.type';
import axiosInstance from './../axiosInstance';

export interface IProjectsQueryParams {
    [key: string]: string | number | boolean | undefined;
}


export const projectsService = {
    getProjects: (params?: IProjectsQueryParams) =>
        axiosInstance.get("/api/projects", { params }),

    getProjectById: (id: string) =>
        axiosInstance.get(`/api/projects/${id}`),

    createProject: (data: Partial<T_projects>) =>
        axiosInstance.post("/api/projects", data),

    updateProject: (id: string, data: Partial<T_projects>) =>
        axiosInstance.patch(`/api/projects/${id}`, data),

    deleteProject: (id: string) =>
        axiosInstance.delete(`/api/projects/${id}`),
};