Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: validate edit collection activity for duplicate collection

jamesgeorge007f132de8dbbd9
diff --git a/store/postwoman.js b/store/postwoman.js
index 61712fb65..b7ae1258d 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;
},