fix: validation for duplicate collections
This commit is contained in:
@@ -111,6 +111,10 @@ export const mutations = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addNewCollection({ collections }, collection) {
|
addNewCollection({ collections }, collection) {
|
||||||
|
const duplicateCollection = collections.some(item => item.name === collection.name)
|
||||||
|
if (duplicateCollection) {
|
||||||
|
alert('Duplicate collection');
|
||||||
|
}
|
||||||
collections.push({
|
collections.push({
|
||||||
name: "",
|
name: "",
|
||||||
folders: [],
|
folders: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user