* Extended functionalities

* Added different UIs
This commit is contained in:
2026-06-24 21:43:40 +02:00
parent 282f4864c4
commit f15bb7a916
348 changed files with 59057 additions and 498 deletions

View File

@@ -0,0 +1,21 @@
import { api } from "@/api/axiosInstance";
import type { MealPlanEntry, ShoppingListItem, UpsertMealPlanEntryInput } from "@/types/meal-plan.types";
export async function fetchMealPlanEntries(from: string, to: string): Promise<MealPlanEntry[]> {
const { data } = await api.get<MealPlanEntry[]>("/meal-plan", { params: { from, to } });
return data;
}
export async function upsertMealPlanEntry(input: UpsertMealPlanEntryInput): Promise<MealPlanEntry> {
const { data } = await api.put<MealPlanEntry>("/meal-plan", input);
return data;
}
export async function deleteMealPlanEntry(id: number): Promise<void> {
await api.delete(`/meal-plan/${id}`);
}
export async function fetchShoppingList(from: string, to: string): Promise<ShoppingListItem[]> {
const { data } = await api.get<ShoppingListItem[]>("/meal-plan/shopping-list", { params: { from, to } });
return data;
}