mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-11 06:22:39 -05:00
fix: Refactor Recipe Zip File Flow (#6170)
This commit is contained in:
@@ -377,11 +377,14 @@ async function deleteRecipe() {
|
||||
const download = useDownloader();
|
||||
|
||||
async function handleDownloadEvent() {
|
||||
const { data } = await api.recipes.getZipToken(props.slug);
|
||||
|
||||
if (data) {
|
||||
download(api.recipes.getZipRedirectUrl(props.slug, data.token), `${props.slug}.zip`);
|
||||
const { data: shareToken } = await api.recipes.share.createOne({ recipeId: props.recipeId });
|
||||
if (!shareToken) {
|
||||
console.error("No share token received");
|
||||
alert.error(i18n.t("events.something-went-wrong"));
|
||||
return;
|
||||
}
|
||||
|
||||
download(api.recipes.share.getZipRedirectUrl(shareToken.id), `${props.slug}.zip`);
|
||||
}
|
||||
|
||||
async function addRecipeToPlan() {
|
||||
|
||||
Reference in New Issue
Block a user