mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 22:59:41 +02:00
feat: Use Backend for Recipe Post Actions (#4163)
This commit is contained in:
parent
8bd26d2230
commit
d8dbcac196
10 changed files with 159 additions and 25 deletions
|
@ -6,9 +6,14 @@ const prefix = "/api";
|
|||
const routes = {
|
||||
groupRecipeActions: `${prefix}/households/recipe-actions`,
|
||||
groupRecipeActionsId: (id: string | number) => `${prefix}/households/recipe-actions/${id}`,
|
||||
groupRecipeActionsIdTriggerRecipeSlug: (id: string | number, recipeSlug: string) => `${prefix}/households/recipe-actions/${id}/trigger/${recipeSlug}`,
|
||||
};
|
||||
|
||||
export class GroupRecipeActionsAPI extends BaseCRUDAPI<CreateGroupRecipeAction, GroupRecipeActionOut> {
|
||||
baseRoute = routes.groupRecipeActions;
|
||||
itemRoute = routes.groupRecipeActionsId;
|
||||
|
||||
async triggerAction(id: string | number, recipeSlug: string) {
|
||||
return await this.requests.post(routes.groupRecipeActionsIdTriggerRecipeSlug(id, recipeSlug), {});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue