Fase 2: Gestión de Atributos Dinámicos (Back & Front EAV Definition)

This commit is contained in:
2025-12-17 13:25:35 -03:00
parent fae9101c63
commit b3b553495b
9 changed files with 184 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import api from './api';
import { AttributeDefinition } from '../types/AttributeDefinition';
export const attributeService = {
getByCategoryId: async (categoryId: number): Promise<AttributeDefinition[]> => {
const response = await api.get<AttributeDefinition[]>(`/attributedefinitions/category/${categoryId}`);
return response.data;
},
create: async (attribute: Partial<AttributeDefinition>): Promise<AttributeDefinition> => {
const response = await api.post<AttributeDefinition>('/attributedefinitions', attribute);
return response.data;
},
delete: async (id: number): Promise<void> => {
await api.delete(`/attributedefinitions/${id}`);
}
};