Skip to content

Commit

Permalink
Fix recipes image upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LeBenLeBen committed Apr 1, 2024
1 parent 91e46c4 commit 52b9121
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/frontend/src/components/forms/ImageUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ function handleImageChange(e: Event) {
const file = (e.target as HTMLInputElement)?.files?.[0];
if (file) {
upload(file).then((response) => {
emit('update:model-value', response);
upload(file).then(({ id, filename_download, storage }) => {
// Take only required values as relations causes issues saving the recipe
emit('update:model-value', {
id,
filename_download,
storage,
});
});
}
}
Expand Down

0 comments on commit 52b9121

Please sign in to comment.