File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1748,7 +1748,6 @@ export class AgentServiceService {
1748
1748
throw new InternalServerErrorException ( `Failed to get agent information: ${ orgAgentResult . reason } ` ) ;
1749
1749
}
1750
1750
1751
- const getApiKey = getApiKeyResult ?. value ;
1752
1751
const orgAgent = orgAgentResult ?. value ;
1753
1752
1754
1753
const orgAgentTypeResult = await this . agentServiceRepository . getOrgAgentType ( orgAgent . orgAgentTypeId ) ;
@@ -1757,6 +1756,17 @@ export class AgentServiceService {
1757
1756
throw new NotFoundException ( ResponseMessages . agent . error . orgAgentNotFound ) ;
1758
1757
}
1759
1758
1759
+ let getApiKey ;
1760
+ if ( OrgAgentType . SHARED ) {
1761
+ const platformAdminSpinnedUp = await this . agentServiceRepository . platformAdminAgent (
1762
+ CommonConstants . PLATFORM_ADMIN_ORG
1763
+ ) ;
1764
+
1765
+ getApiKey = await this . commonService . decryptPassword ( platformAdminSpinnedUp ?. org_agents [ 0 ] . apiKey ) ;
1766
+ } else {
1767
+ getApiKey = getApiKeyResult ?. value ;
1768
+ }
1769
+
1760
1770
// Determine the URL based on the agent type
1761
1771
const url =
1762
1772
orgAgentTypeResult . agent === OrgAgentType . SHARED
Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ export class SchemaService extends BaseService {
649
649
const response = await this . schemaRepository . getAllSchemaDetails ( schemaSearchCriteria ) ;
650
650
const schemasDetails = response ?. schemasResult . map ( ( schemaAttributeItem ) => {
651
651
const attributes = JSON . parse ( schemaAttributeItem . attributes ) ;
652
- return { ...schemaAttributeItem , attributes, organizationName : schemaAttributeItem . organisation . name } ;
652
+ return { ...schemaAttributeItem , attributes, organizationName : schemaAttributeItem . organisation ? .name || '' } ;
653
653
} ) ;
654
654
655
655
const schemasResponse = {
You can’t perform that action at this time.
0 commit comments