From 2853a4bbef8e3ded138d7dcb4be8d074a08a6907 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 16:37:04 +0530 Subject: [PATCH] fix: validation for duplicate collections --- store/postwoman.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/store/postwoman.js b/store/postwoman.js index bf5881268..895464977 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -111,6 +111,10 @@ export const mutations = { }, addNewCollection({ collections }, collection) { + const duplicateCollection = collections.some(item => item.name === collection.name) + if (duplicateCollection) { + alert('Duplicate collection'); + } collections.push({ name: "", folders: [],