Skip to content

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

fix: save request crashing on teams

Andrew Bastin4236d1179c10
diff --git a/packages/hoppscotch-app/components/collections/SaveRequest.vue b/packages/hoppscotch-app/components/collections/SaveRequest.vue
index 9b304e73d..58daaea7d 100644
--- a/packages/hoppscotch-app/components/collections/SaveRequest.vue
+++ b/packages/hoppscotch-app/components/collections/SaveRequest.vue
@@ -37,7 +37,7 @@
:picked="picked"
:save-request="true"
@select="onSelect"
- @update-collection="collectionsType.type = $event"
+ @update-collection="updateColl"
@update-coll-type="onUpdateCollType"
/>
</div>
@@ -259,7 +259,7 @@ const saveRequestAs = async () => {
requestIndex: insertionIndex,
})
} else if (picked.value.pickedType === "teams-request") {
- if (isHoppRESTRequest(requestUpdated))
+ if (!isHoppRESTRequest(requestUpdated))
throw new Error("requestUpdated is not a REST Request")
if (collectionsType.value.type !== "team-collections")
@@ -277,7 +277,7 @@ const saveRequestAs = async () => {
requestID: picked.value.requestID,
})
} else if (picked.value.pickedType === "teams-folder") {
- if (isHoppRESTRequest(requestUpdated))
+ if (!isHoppRESTRequest(requestUpdated))
throw new Error("requestUpdated is not a REST Request")
if (collectionsType.value.type !== "team-collections")
@@ -300,7 +300,7 @@ const saveRequestAs = async () => {
})
}
} else if (picked.value.pickedType === "teams-collection") {
- if (isHoppRESTRequest(requestUpdated))
+ if (!isHoppRESTRequest(requestUpdated))
throw new Error("requestUpdated is not a REST Request")
if (collectionsType.value.type !== "team-collections")
@@ -347,4 +347,8 @@ const saveRequestAs = async () => {
})
hideModal()
}
+
+const updateColl = (ev: CollectionType["type"]) => {
+ collectionsType.value.type = ev
+}
</script>
diff --git a/packages/hoppscotch-app/helpers/fb/environments.ts b/packages/hoppscotch-app/helpers/fb/environments.ts
index 6452430d8..a2fd0b4f4 100644
--- a/packages/hoppscotch-app/helpers/fb/environments.ts
+++ b/packages/hoppscotch-app/helpers/fb/environments.ts
@@ -43,8 +43,6 @@ async function writeEnvironments(environment: Environment[]) {
environment,
}
- console.log(ev)
-
try {
await setDoc(
doc(
@@ -87,7 +85,6 @@ async function writeGlobalEnvironment(variables: Environment["variables"]) {
export function initEnvironments() {
environments$.subscribe((envs) => {
- console.log("env update")
if (
currentUser$.value &&
settingsStore.value.syncEnvironments &&