From f091c1bdc5b9ef991e1df8b64c37e313fc4cc9b9 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:27:32 +0530 Subject: [PATCH] chore: remove reference to `ReqType` enum The `ReqType` enum isn't available in the cloud context since the BE only deals with teams and GQL isn't supported under the same, hence there isn't a use case to differentiate between request types from the cloud BE context. --- .../src/components/collections/SaveRequest.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/hoppscotch-common/src/components/collections/SaveRequest.vue b/packages/hoppscotch-common/src/components/collections/SaveRequest.vue index fdb40c3c1..54d1a93b5 100644 --- a/packages/hoppscotch-common/src/components/collections/SaveRequest.vue +++ b/packages/hoppscotch-common/src/components/collections/SaveRequest.vue @@ -135,7 +135,6 @@ import { useSubmitFeedback, } from "~/composables/ai-experiments" import { GQLError } from "~/helpers/backend/GQLClient" -import { ReqType } from "~/helpers/backend/graphql" import { createRequestInCollection, updateTeamRequest, @@ -549,7 +548,7 @@ const saveRequestAs = async () => { headers, } - requestSaved(ReqType.Gql) + requestSaved("GQL") } else if (picked.value.pickedType === "gql-my-folder") { // TODO: Check for GQL request ? const insertionIndex = saveGraphqlRequestAs( @@ -584,7 +583,7 @@ const saveRequestAs = async () => { headers, } - requestSaved(ReqType.Gql) + requestSaved("GQL") } else if (picked.value.pickedType === "gql-my-collection") { // TODO: Check for GQL request ? const insertionIndex = saveGraphqlRequestAs( @@ -619,7 +618,7 @@ const saveRequestAs = async () => { headers, } - requestSaved(ReqType.Gql) + requestSaved("GQL") } } @@ -674,10 +673,10 @@ const updateTeamCollectionOrFolder = ( )() } -const requestSaved = (tab: ReqType = ReqType.Rest) => { +const requestSaved = (tab: "REST" | "GQL" = "REST") => { toast.success(`${t("request.added")}`) nextTick(() => { - if (tab === ReqType.Rest) { + if (tab === "REST") { RESTTabs.currentActiveTab.value.document.isDirty = false } else { GQLTabs.currentActiveTab.value.document.isDirty = false