fix: save request crashing on teams
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
:picked="picked"
|
:picked="picked"
|
||||||
:save-request="true"
|
:save-request="true"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
@update-collection="collectionsType.type = $event"
|
@update-collection="updateColl"
|
||||||
@update-coll-type="onUpdateCollType"
|
@update-coll-type="onUpdateCollType"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -259,7 +259,7 @@ const saveRequestAs = async () => {
|
|||||||
requestIndex: insertionIndex,
|
requestIndex: insertionIndex,
|
||||||
})
|
})
|
||||||
} else if (picked.value.pickedType === "teams-request") {
|
} else if (picked.value.pickedType === "teams-request") {
|
||||||
if (isHoppRESTRequest(requestUpdated))
|
if (!isHoppRESTRequest(requestUpdated))
|
||||||
throw new Error("requestUpdated is not a REST Request")
|
throw new Error("requestUpdated is not a REST Request")
|
||||||
|
|
||||||
if (collectionsType.value.type !== "team-collections")
|
if (collectionsType.value.type !== "team-collections")
|
||||||
@@ -277,7 +277,7 @@ const saveRequestAs = async () => {
|
|||||||
requestID: picked.value.requestID,
|
requestID: picked.value.requestID,
|
||||||
})
|
})
|
||||||
} else if (picked.value.pickedType === "teams-folder") {
|
} else if (picked.value.pickedType === "teams-folder") {
|
||||||
if (isHoppRESTRequest(requestUpdated))
|
if (!isHoppRESTRequest(requestUpdated))
|
||||||
throw new Error("requestUpdated is not a REST Request")
|
throw new Error("requestUpdated is not a REST Request")
|
||||||
|
|
||||||
if (collectionsType.value.type !== "team-collections")
|
if (collectionsType.value.type !== "team-collections")
|
||||||
@@ -300,7 +300,7 @@ const saveRequestAs = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (picked.value.pickedType === "teams-collection") {
|
} else if (picked.value.pickedType === "teams-collection") {
|
||||||
if (isHoppRESTRequest(requestUpdated))
|
if (!isHoppRESTRequest(requestUpdated))
|
||||||
throw new Error("requestUpdated is not a REST Request")
|
throw new Error("requestUpdated is not a REST Request")
|
||||||
|
|
||||||
if (collectionsType.value.type !== "team-collections")
|
if (collectionsType.value.type !== "team-collections")
|
||||||
@@ -347,4 +347,8 @@ const saveRequestAs = async () => {
|
|||||||
})
|
})
|
||||||
hideModal()
|
hideModal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateColl = (ev: CollectionType["type"]) => {
|
||||||
|
collectionsType.value.type = ev
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ async function writeEnvironments(environment: Environment[]) {
|
|||||||
environment,
|
environment,
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(ev)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await setDoc(
|
await setDoc(
|
||||||
doc(
|
doc(
|
||||||
@@ -87,7 +85,6 @@ async function writeGlobalEnvironment(variables: Environment["variables"]) {
|
|||||||
|
|
||||||
export function initEnvironments() {
|
export function initEnvironments() {
|
||||||
environments$.subscribe((envs) => {
|
environments$.subscribe((envs) => {
|
||||||
console.log("env update")
|
|
||||||
if (
|
if (
|
||||||
currentUser$.value &&
|
currentUser$.value &&
|
||||||
settingsStore.value.syncEnvironments &&
|
settingsStore.value.syncEnvironments &&
|
||||||
|
|||||||
Reference in New Issue
Block a user