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 });
}
}