import { baseClient } from './base.js';

export const projectsApi = {
  list(workspaceId) {
    return baseClient.get(`/workspaces/${workspaceId}/projects`);
  },

  create(workspaceId, name, description = '') {
    return baseClient.post(`/workspaces/${workspaceId}/projects`, { name, description });
  },

  get(workspaceId, id) {
    return baseClient.get(`/workspaces/${workspaceId}/projects/${id}`);
  },

  update(workspaceId, id, data) {
    return baseClient.put(`/workspaces/${workspaceId}/projects/${id}`, data);
  },

  delete(workspaceId, id) {
    return baseClient.delete(`/workspaces/${workspaceId}/projects/${id}`);
  },
};
