chore: validate edit collection activity for duplicate collection
This commit is contained in:
@@ -132,6 +132,12 @@ export const mutations = {
|
|||||||
|
|
||||||
editCollection({ collections }, payload) {
|
editCollection({ collections }, payload) {
|
||||||
const { collection, collectionIndex } = 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;
|
collections[collectionIndex] = collection;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user