This commit is contained in:
Michael Genson 2025-07-25 00:00:25 +00:00
commit 53668bcbc4

View file

@ -232,7 +232,8 @@ export default defineNuxtComponent({
if (!newEvent) { if (!newEvent) {
throw new Error("No event created"); throw new Error("No event created");
} }
} catch (error) { }
catch (error) {
console.error("Failed to create timeline event:", error); console.error("Failed to create timeline event:", error);
alert.error(i18n.t("recipe.failed-to-add-to-timeline")); alert.error(i18n.t("recipe.failed-to-add-to-timeline"));
resetMadeThisForm(); resetMadeThisForm();
@ -244,7 +245,8 @@ export default defineNuxtComponent({
try { try {
lastMade.value = newTimelineEvent.value.timestamp; lastMade.value = newTimelineEvent.value.timestamp;
await userApi.recipes.updateLastMade(props.recipe.slug, newTimelineEvent.value.timestamp); await userApi.recipes.updateLastMade(props.recipe.slug, newTimelineEvent.value.timestamp);
} catch (error) { }
catch (error) {
console.error("Failed to update last made date:", error); console.error("Failed to update last made date:", error);
alert.error(i18n.t("recipe.failed-to-update-recipe")); alert.error(i18n.t("recipe.failed-to-update-recipe"));
} }
@ -262,7 +264,8 @@ export default defineNuxtComponent({
if (imageResponse.data) { if (imageResponse.data) {
newEvent.image = imageResponse.data.image; newEvent.image = imageResponse.data.image;
} }
} catch (error) { }
catch (error) {
imageError = true; imageError = true;
console.error("Failed to upload image for timeline event:", error); console.error("Failed to upload image for timeline event:", error);
} }
@ -270,7 +273,8 @@ export default defineNuxtComponent({
if (imageError) { if (imageError) {
alert.error(i18n.t("recipe.added-to-timeline-but-failed-to-add-image")); alert.error(i18n.t("recipe.added-to-timeline-but-failed-to-add-image"));
} else { }
else {
alert.success(i18n.t("recipe.added-to-timeline")); alert.success(i18n.t("recipe.added-to-timeline"));
} }