1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00

feat(frontend): 🚧 groundwork for user interactive ingredient parsing

This commit is contained in:
hay-kot 2021-08-28 14:14:21 -08:00
parent f8c2f760bd
commit 0f6f81eb27
5 changed files with 129 additions and 9 deletions

View file

@ -10,6 +10,7 @@ const routes = {
recipesCreateUrl: `${prefix}/recipes/create-url`,
recipesCreateFromZip: `${prefix}/recipes/create-from-zip`,
recipesCategory: `${prefix}/recipes/category`,
recipesParseIngredients: `${prefix}/parse/ingredient`,
recipesRecipeSlug: (recipe_slug: string) => `${prefix}/recipes/${recipe_slug}`,
recipesRecipeSlugZip: (recipe_slug: string) => `${prefix}/recipes/${recipe_slug}/zip`,
@ -81,4 +82,8 @@ export class RecipeAPI extends BaseCRUDAPI<Recipe, CreateRecipe> {
async deleteComment(slug: string, id: number) {
return await this.requests.delete(routes.recipesSlugCommentsId(slug, id));
}
async parseIngredients(ingredients: Array<string>) {
return await this.requests.post(routes.recipesParseIngredients, { ingredients });
}
}