Merge pull request #548 from liyasthomas/hotfix/validate-collection
fix(chore): Take letter casing into account while checking for duplicate collection
This commit is contained in:
@@ -112,7 +112,7 @@ export const mutations = {
|
|||||||
|
|
||||||
addNewCollection({ collections }, collection) {
|
addNewCollection({ collections }, collection) {
|
||||||
const { name } = collection;
|
const { name } = collection;
|
||||||
const duplicateCollection = collections.some(item => item.name === name);
|
const duplicateCollection = collections.some(item => item.name.toLowerCase() === name.toLowerCase());
|
||||||
if (duplicateCollection) {
|
if (duplicateCollection) {
|
||||||
this.$toast.info("Duplicate collection");
|
this.$toast.info("Duplicate collection");
|
||||||
return;
|
return;
|
||||||
@@ -133,7 +133,7 @@ export const mutations = {
|
|||||||
editCollection({ collections }, payload) {
|
editCollection({ collections }, payload) {
|
||||||
const { collection, collectionIndex } = payload;
|
const { collection, collectionIndex } = payload;
|
||||||
const { name } = collection;
|
const { name } = collection;
|
||||||
const duplicateCollection = collections.some(item => item.name === name);
|
const duplicateCollection = collections.some(item => item.name.toLowerCase() === name.toLowerCase());
|
||||||
if (duplicateCollection) {
|
if (duplicateCollection) {
|
||||||
this.$toast.info("Duplicate collection");
|
this.$toast.info("Duplicate collection");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user