Skip to content

Commit

Permalink
Fix category saving
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Aug 13, 2023
1 parent 2adf6ae commit df0d0eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Ingredient/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<div class="form-group">
<label class="form-label form-label--required" for="category">{{ $t('category') }}:</label>
<select class="form-select" id="category" v-model="ingredient.ingredient_category_id" required>
<select class="form-select" id="category" v-model="ingredient.category.id" required>
<option :value="undefined" disabled>{{ $t('select-category') }}</option>
<option v-for="cat in categories" :value="cat.id">{{ cat.name }}</option>
</select>
Expand Down Expand Up @@ -77,6 +77,7 @@ export default {
ingredients: [],
ingredient: {
color: '#000',
category: {},
images: []
},
categories: []
Expand Down Expand Up @@ -132,7 +133,7 @@ export default {
color: this.ingredient.color,
parent_ingredient_id: this.isParent && this.ingredient.parent_ingredient ? this.ingredient.parent_ingredient.id : null,
images: [],
ingredient_category_id: this.ingredient.ingredient_category_id,
ingredient_category_id: this.ingredient.category.id,
};
const imageResources = await this.$refs.imagesUpload.uploadPictures().catch(() => {
Expand Down

0 comments on commit df0d0eb

Please sign in to comment.