mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feat: add the selected recipe servings and yields in the content of the recipe post action (#5340)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
parent
ac984a2d04
commit
78b55c0b98
5 changed files with 12 additions and 6 deletions
|
@ -4,6 +4,7 @@ import { useUserApi } from "~/composables/api";
|
|||
import { GroupRecipeActionOut, GroupRecipeActionType } from "~/lib/api/types/household";
|
||||
import { RequestResponse } from "~/lib/api/types/non-generated";
|
||||
import { Recipe } from "~/lib/api/types/recipe";
|
||||
import { useScaledAmount } from "~/composables/recipes/use-scaled-amount";
|
||||
|
||||
const groupRecipeActions = ref<GroupRecipeActionOut[] | null>(null);
|
||||
const loading = ref(false);
|
||||
|
@ -69,7 +70,7 @@ export const useGroupRecipeActions = function (
|
|||
window.open(url, "_blank")?.focus();
|
||||
return;
|
||||
case "post":
|
||||
return await api.groupRecipeActions.triggerAction(action.id, recipe.slug || "");
|
||||
return await api.groupRecipeActions.triggerAction(action.id, recipe.slug || "", useScaledAmount(recipe.recipeServings || 1, recipeScale).scaledAmount);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ const routes = {
|
|||
baseRoute = routes.groupRecipeActions;
|
||||
itemRoute = routes.groupRecipeActionsId;
|
||||
|
||||
async triggerAction(id: string | number, recipeSlug: string) {
|
||||
return await this.requests.post(routes.groupRecipeActionsIdTriggerRecipeSlug(id, recipeSlug), {});
|
||||
async triggerAction(id: string | number, recipeSlug: string, scaledAmount: number) {
|
||||
return await this.requests.post(routes.groupRecipeActionsIdTriggerRecipeSlug(id, recipeSlug), {scaledAmount});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue