1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 05:09:40 +02:00

add expiring share links to url recipe actions

This commit is contained in:
Ian Pösse-Koch 2024-12-03 22:24:59 +01:00 committed by Michael Genson
parent b00c9acd5c
commit da8aaabe07

View file

@ -50,13 +50,13 @@ export const useGroupRecipeActions = function (
}
async function parseRecipeActionUrl(url: string, recipe: Recipe, recipeScale: number): Promise<string> {
const recipeServings = (recipe.recipeServings || 1) * recipeScale;
const recipeYieldQuantity = (recipe.recipeYieldQuantity || 1) * recipeScale;
/* eslint-disable no-template-curly-in-string */
const shareLinkRegex = /\$\{share-link-expires-seconds-[0-9]+\}/g;
const group = (await api.groups.getOne(recipe.groupId || "")).data;
const recipeServings = (recipe.recipeServings || 1) * recipeScale;
const recipeYieldQuantity = (recipe.recipeYieldQuantity || 1) * recipeScale;
const shareLinkStringMatches = url.matchAll(shareLinkRegex);
if (shareLinkStringMatches) {