mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-27 00:04:23 -04:00
feat: Use Backend for Recipe Post Actions (#4163)
This commit is contained in:
@@ -165,6 +165,10 @@ export interface GroupRecipeActionOut {
|
||||
householdId: string;
|
||||
id: string;
|
||||
}
|
||||
export interface GroupRecipeActionPayload {
|
||||
action: GroupRecipeActionOut;
|
||||
content: unknown;
|
||||
}
|
||||
export interface HouseholdCreate {
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
|
||||
@@ -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), {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user