From 68d18e6841df34c29bcc0c353e298e50a02325bd Mon Sep 17 00:00:00 2001 From: Andrew <43643821+AndrewTwydell@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:33:29 +0000 Subject: [PATCH] handle system group response Co-authored-by: Dave Nice <32769325+davenice@users.noreply.github.com> Signed-off-by: Andrew <43643821+AndrewTwydell@users.noreply.github.com> --- packages/vsce/src/utils/profileManagement.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/vsce/src/utils/profileManagement.ts b/packages/vsce/src/utils/profileManagement.ts index 74ce2cec..7ef1fd5d 100644 --- a/packages/vsce/src/utils/profileManagement.ts +++ b/packages/vsce/src/utils/profileManagement.ts @@ -9,7 +9,7 @@ * */ -import { getCache, getResource, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; +import { getCache, getResource } from "@zowe/cics-for-zowe-sdk"; import { Session } from "@zowe/imperative"; import { imperative, Types, ZoweVsCodeExtension } from "@zowe/zowe-explorer-api"; import { window } from "vscode"; @@ -71,14 +71,17 @@ export class ProfileManagement { public static async regionIsGroup(session: Session, profile: imperative.IProfile): Promise { - let checkIfSystemGroup: ICMCIApiResponse; + let isGroup = false; try { - checkIfSystemGroup = await getResource(session, { + const checkIfSystemGroup = await getResource(session, { name: "CICSRegionGroup", cicsPlex: profile.cicsPlex, regionName: profile.regionName, criteria: `GROUP=${profile.regionName}`, }); + if (checkIfSystemGroup && checkIfSystemGroup.response.resultsummary.recordcount !== "0") { + isGroup = true; + } } catch (error) { if (error instanceof imperative.ImperativeError) { if (!error.mDetails.msg.toUpperCase().includes("NODATA")) { @@ -87,7 +90,7 @@ export class ProfileManagement { } } - return checkIfSystemGroup?.response.resultsummary.recordcount !== "0"; + return isGroup; } public static async isPlex(session: Session): Promise {