chore: validate edit collection activity for duplicate collection
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user