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