Fase 2: Implementación de la Matriz de Operaciones (Backend & Frontend)

This commit is contained in:
2025-12-17 13:21:50 -03:00
parent 523a8394ae
commit fae9101c63
8 changed files with 251 additions and 1 deletions

View File

@@ -23,5 +23,18 @@ export const categoryService = {
delete: async (id: number): Promise<void> => {
await api.delete(`/categories/${id}`);
},
getOperations: async (id: number): Promise<import('../types/Operation').Operation[]> => {
const response = await api.get(`/categories/${id}/operations`);
return response.data;
},
addOperation: async (categoryId: number, operationId: number): Promise<void> => {
await api.post(`/categories/${categoryId}/operations/${operationId}`);
},
removeOperation: async (categoryId: number, operationId: number): Promise<void> => {
await api.delete(`/categories/${categoryId}/operations/${operationId}`);
}
};