import instance from './instance';

export const getProjectList = async (data?: Record<string, any>) => {
  const response = await instance.get('/api/v1/projects', {
    params: data
  });
  return response.data;
};

export const getProject = async (id: string) => {
  const response = await instance.get(`/api/v1/projects/${id}`);
  return response.data;
};

export const createProject = async (data: any) => {
  const response = await instance.post('/api/v1/projects', data);
  return response.data;
};

export const updateProject = async (id: string, data: any) => {
  const response = await instance.put(`/api/v1/projects/${id}`, data);
  return response.data;
};

export const deleteProject = async (id: string) => {
  const response = await instance.delete(`/api/v1/projects/${id}`);
  return response.data;
};
