diff --git a/packages/hoppscotch-common/src/components/collections/Properties.vue b/packages/hoppscotch-common/src/components/collections/Properties.vue index ad2def9f..219ea567 100644 --- a/packages/hoppscotch-common/src/components/collections/Properties.vue +++ b/packages/hoppscotch-common/src/components/collections/Properties.vue @@ -157,7 +157,7 @@ const toast = useToast() const props = withDefaults( defineProps<{ show: boolean - loadingState: boolean + loadingState?: boolean editingProperties: EditingProperties source: "REST" | "GraphQL" modelValue: string diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vue index 55a77450..43fc4636 100644 --- a/packages/hoppscotch-common/src/components/collections/index.vue +++ b/packages/hoppscotch-common/src/components/collections/index.vue @@ -2796,8 +2796,13 @@ const setCollectionProperties = (newCollection: { path: string }) => { const { collection, path, isRootCollection } = newCollection + if (!collection) return + // We default to using collection.id but during the callback to our application, collection.id is not being preserved. + // Since path is being preserved, we extract the collectionId from path instead + const collectionId = collection.id ?? path.split("/").pop() + if (collectionsType.value.type === "my-collections") { if (isRootCollection) { editRESTCollection(parseInt(path), collection) @@ -2818,13 +2823,13 @@ const setCollectionProperties = (newCollection: { ) }) toast.success(t("collection.properties_updated")) - } else if (hasTeamWriteAccess.value && collection.id) { + } else if (hasTeamWriteAccess.value && collectionId) { const data = { auth: collection.auth, headers: collection.headers, } pipe( - updateTeamCollection(collection.id, JSON.stringify(data), undefined), + updateTeamCollection(collectionId, JSON.stringify(data), undefined), TE.match( (err: GQLError) => { toast.error(`${getErrorMessage(err)}`)