Skip to content

Commit

Permalink
Merge pull request #518 from c2corg/fix-image-categories
Browse files Browse the repository at this point in the history
Fix image creation : categories was not saved #511
  • Loading branch information
cbeauchesne authored Apr 10, 2019
2 parents a4c9787 + 8c9a972 commit 6b1e718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/images-uploader/ImageUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<label class="checkbox">
<input
type="checkbox"
:checked="document.image_categories.includes(item)"
:checked="document.categories.includes(item)"
@input="toggleCategory(item)">
{{ $gettext(item, 'image_categories') | uppercaseFirstLetter }}
</label>
Expand Down Expand Up @@ -232,15 +232,15 @@
},
toggleCategory(category) {
const newValue = this.document.image_categories.slice(0);
const newValue = this.document.categories.slice(0);
if (!newValue.includes(category)) {
newValue.push(category);
} else {
newValue.splice(newValue.indexOf(category), 1);
}
this.document.image_categories = newValue;
this.document.categories = newValue;
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/components/images-uploader/ImagesUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
image.document.geometry.geom = this.parentDocument.geometry ? this.parentDocument.geometry.geom : null;
image.document.file_size = file.size;
image.document.image_type = this.imageType;
image.document.image_categories = [];
image.document.quality = 'medium';
image.document.associations[associationsArrayName] = [
{ document_id: this.parentDocument.document_id }
Expand Down

0 comments on commit 6b1e718

Please sign in to comment.