fix recipe image creation

This commit is contained in:
Kuchenpirat 2025-06-26 11:39:37 +00:00
commit 6ba0df9230
2 changed files with 2 additions and 3 deletions

View file

@ -150,7 +150,7 @@ export default defineNuxtComponent({
state.loading = true; state.loading = true;
const translateLanguage = shouldTranslate.value ? i18n.locale : undefined; const translateLanguage = shouldTranslate.value ? i18n.locale : undefined;
const { data, error } = await api.recipes.createOneFromImage(uploadedImage.value, uploadedImageName.value, translateLanguage); const { data, error } = await api.recipes.createOneFromImage(uploadedImage.value, uploadedImageName.value, translateLanguage?.value);
if (error || !data) { if (error || !data) {
alert.error(i18n.t("events.something-went-wrong")); alert.error(i18n.t("events.something-went-wrong"));
state.loading = false; state.loading = false;

View file

@ -7,8 +7,7 @@ export default defineNuxtPlugin(() => {
baseURL: "/", // api calls already pass with /api baseURL: "/", // api calls already pass with /api
timeout: 10000, timeout: 10000,
headers: { headers: {
"Content-Type": "application/json", Authorization: "Bearer " + useCookie(tokenName).value,
"Authorization": "Bearer " + useCookie(tokenName).value,
}, },
withCredentials: true, withCredentials: true,
}); });