From f132de8dbbd956e1027b53d3ded8008c6ae08095 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Thu, 23 Jan 2020 14:57:44 +0530 Subject: [PATCH] chore: validate edit collection activity for duplicate collection --- store/postwoman.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/store/postwoman.js b/store/postwoman.js index 61712fb6..b7ae1258 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -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; },