diff options
author | Ivan Gamboa Ultreras <36210451+Zivangu9@users.noreply.github.com> | 2022-05-26 03:23:59 +0300 |
---|---|---|
committer | Ivan Gamboa Ultreras <36210451+Zivangu9@users.noreply.github.com> | 2022-05-28 01:41:05 +0300 |
commit | efe929a5fee2a72b1e783115064e4c4adbe683f6 (patch) | |
tree | bfa8df5e4370400d28f25ea48032f65bf4377071 /src | |
parent | 22d3d637de582fa6e71b736bd99f084b19cce2d8 (diff) |
Duplicity validation
Add a validation when trying to create a new tag, in case the displayName already exists in the list of tags it is rejected
Co-Authored-By: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: Ivan Gamboa Ultreras <36210451+Zivangu9@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/TagModal.vue | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/TagModal.vue b/src/components/TagModal.vue index 6106f7cd1..3e546d866 100644 --- a/src/components/TagModal.vue +++ b/src/components/TagModal.vue @@ -173,7 +173,10 @@ export default { async createTag(event) { this.editing = true const displayName = event.target.querySelector('input[type=text]').value - + if (this.$store.getters.getTags.some(tag => tag.displayName === displayName)) { + showError(this.t('mail', 'Tag already exists')) + return + } try { await this.$store.dispatch('createTag', { displayName, |