renamed models, added mapper for recipes

This commit is contained in:
Anika Raemer 2025-10-07 20:53:31 +02:00
parent 7a6f5b5bcd
commit 8027fce80d
21 changed files with 164 additions and 61 deletions

View file

@ -1,5 +1,5 @@
import type { Recipe } from "../../types/recipe"
import { get, postJson, putJson } from "../utils/requests";
import type { RecipeModel } from "../../models/RecipeModel"
import { get } from "../utils/requests";
/**
@ -18,7 +18,7 @@ const RECIPE_URL = `${BASE_URL}/compact-recipe`
* @param searchString Search string for filtering recipeList
* @returns Array of recipe
*/
export async function fetchRecipeList(searchString : string): Promise<Recipe[]> {
export async function fetchRecipeList(searchString : string): Promise<RecipeModel[]> {
let url : string = RECIPE_URL;
// if there's a search string add it as query parameter
if(searchString && searchString !== ""){