Feat: Configuración y Administración de Tipos

This commit is contained in:
2026-02-25 18:11:52 -03:00
parent a8b8229b41
commit b4fa74ad9b
25 changed files with 941 additions and 107 deletions

View File

@@ -0,0 +1,23 @@
import api from './api';
import type { ProductType } from '../types/Product';
export const productTypeService = {
getAll: async (): Promise<ProductType[]> => {
const res = await api.get('/producttypes');
return res.data;
},
getById: async (id: number): Promise<ProductType> => {
const res = await api.get(`/producttypes/${id}`);
return res.data;
},
create: async (data: Partial<ProductType>): Promise<ProductType> => {
const res = await api.post('/producttypes', data);
return res.data;
},
update: async (id: number, data: Partial<ProductType>): Promise<void> => {
await api.put(`/producttypes/${id}`, data);
},
delete: async (id: number): Promise<void> => {
await api.delete(`/producttypes/${id}`);
}
};