From b0ba7f1520fbd608c5f1bdd4bea3e6653ad27708 Mon Sep 17 00:00:00 2001 From: Pedro Sanders Date: Fri, 1 Mar 2024 00:50:15 -0500 Subject: [PATCH] fix: handle domain without egressPolicies --- mods/ctl/src/commands/agents/get.ts | 3 +-- mods/pgdata/src/mappers/domain.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ctl/src/commands/agents/get.ts b/mods/ctl/src/commands/agents/get.ts index 42acb9cbb..f9d532a9a 100644 --- a/mods/ctl/src/commands/agents/get.ts +++ b/mods/ctl/src/commands/agents/get.ts @@ -21,10 +21,9 @@ import * as grpc from "@grpc/grpc-js" import { CliUx, Command, Flags } from "@oclif/core" import { BaseCommand } from "../../base" import { capitalize, showPaginatedList, ShowTable } from "../../utils" -import { CommonConnect as CC } from "@routr/common" +import { CommonConnect as CC, CommonTypes as CT } from "@routr/common" import { CLIError } from "@oclif/core/lib/errors" import { CommandError } from "@oclif/core/lib/interfaces" -import { CommonTypes as CT } from "@routr/common" export default class GetAgentsCommand extends BaseCommand { static readonly description = diff --git a/mods/pgdata/src/mappers/domain.ts b/mods/pgdata/src/mappers/domain.ts index f527c2326..0db95e255 100644 --- a/mods/pgdata/src/mappers/domain.ts +++ b/mods/pgdata/src/mappers/domain.ts @@ -102,7 +102,7 @@ export class DomainManager extends EntityManager { ...domain, accessControlListRef: domain.accessControlList?.ref, accessControlList: ACLManager.mapToDto(domain.accessControlList), - egressPolicies: domain.egressPolicies.map((policy) => ({ + egressPolicies: domain.egressPolicies?.map((policy) => ({ rule: policy.rule, numberRef: policy.numberRef, number: NumberManager.mapToDtoWithoutTrunk(policy.number)