- add grocery category

- add Dockerfile
This commit is contained in:
2025-05-26 21:55:49 +02:00
parent 6118415f05
commit f88a931008
23 changed files with 1304 additions and 937 deletions

View File

@@ -1,4 +1,4 @@
import { Product, ProductCreate, Shop, ShopCreate, ShoppingEvent, ShoppingEventCreate, Brand, BrandCreate, Grocery, GroceryCreate } from '../types';
import { Product, ProductCreate, Shop, ShopCreate, ShoppingEvent, ShoppingEventCreate, Brand, BrandCreate, Grocery, GroceryCreate, GroceryCategory, GroceryCategoryCreate } from '../types';
const API_BASE_URL = 'http://localhost:8000';
@@ -51,6 +51,15 @@ export const brandApi = {
delete: (id: number) => api.delete(`/brands/${id}`),
};
// Grocery Category API functions
export const groceryCategoryApi = {
getAll: () => api.get<GroceryCategory[]>('/grocery-categories/'),
getById: (id: number) => api.get<GroceryCategory>(`/grocery-categories/${id}`),
create: (category: GroceryCategoryCreate) => api.post<GroceryCategory>('/grocery-categories/', category),
update: (id: number, category: Partial<GroceryCategoryCreate>) => api.put<GroceryCategory>(`/grocery-categories/${id}`, category),
delete: (id: number) => api.delete(`/grocery-categories/${id}`),
};
// Shopping Event API functions
export const shoppingEventApi = {
getAll: () => api.get<ShoppingEvent[]>('/shopping-events/'),