chore: validate edit collection activity for duplicate collection

This commit is contained in:
jamesgeorge007
2020-01-23 14:57:44 +05:30
parent b0c22a2b2d
commit f132de8dbb

View File

@@ -132,6 +132,12 @@ export const mutations = {
editCollection({ collections }, payload) {
const { collection, collectionIndex } = payload;
const { name } = collection
const duplicateCollection = collections.some(item => item.name === name)
if (duplicateCollection) {
this.$toast.info('Duplicate collection');
return;
}
collections[collectionIndex] = collection;
},