import axios from "axios"; import type { GetRecipeOfTheWeekResponse } from "../types/api/recipe"; import type { Recipe } from "../types/recipe"; import type { ApiError } from "../types/api/error"; export async function GetRecipeOfTheWeek (): Promise { const response = await axios.get("http://localhost:3000/v2/api/recipe/of-the-week"); if (response.status !== 200 || response.data.recipe === undefined) { const err: ApiError = { status: response.data.status, message: response.data.message }; return err; } return response.data.recipe; }