fix: error when trying to change recipe image (#5771)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Mario Džoić
2025-08-16 10:41:46 +02:00
committed by GitHub
parent 6cbc308d83
commit c41a4a52ed
7 changed files with 115 additions and 26 deletions

View File

@@ -390,8 +390,6 @@ const props = defineProps({
const emit = defineEmits(["click-instruction-field", "update:assets"]);
const BASE_URL = useRequestURL().origin;
const { isCookMode, toggleCookMode, isEditForm } = usePageState(props.recipe.slug);
const dialog = ref(false);
@@ -695,7 +693,7 @@ async function handleImageDrop(index: number, files: File[]) {
}
emit("update:assets", [...assets.value, data]);
const assetUrl = BASE_URL + recipeAssetPath(props.recipe.id, data.fileName as string);
const assetUrl = recipeAssetPath(props.recipe.id, data.fileName as string);
const text = `<img src="${assetUrl}" height="100%" width="100%"/>`;
instructionList.value[index].text += text;
}