Skip to content

Commit

Permalink
handle system group response
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Nice <[email protected]>
Signed-off-by: Andrew <[email protected]>
  • Loading branch information
AndrewTwydell and davenice authored Jan 8, 2025
1 parent 1f3eb1e commit 1984e89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/vsce/src/utils/profileManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,17 @@ export class ProfileManagement {

public static async regionIsGroup(session: Session, profile: imperative.IProfile): Promise<boolean> {

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")) {
Expand All @@ -87,7 +90,7 @@ export class ProfileManagement {
}
}

return checkIfSystemGroup?.response.resultsummary.recordcount !== "0";
return isGroup;
}

public static async isPlex(session: Session): Promise<string | null> {
Expand Down

0 comments on commit 1984e89

Please sign in to comment.