From ab13b976a9c43f6fcb7d9a5fdb243f690f9cb41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristina=20Isabel=20Ca=C3=B1izales?= Date: Fri, 17 Jan 2025 23:01:15 -0300 Subject: [PATCH] chore: update operations on overwrite --- .../src/commands/apexActionController.ts | 7 ++++++- packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts | 1 + packages/salesforcedx-vscode-apex/src/messages/i18n.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/salesforcedx-vscode-apex/src/commands/apexActionController.ts b/packages/salesforcedx-vscode-apex/src/commands/apexActionController.ts index 6191a01354..81431d349c 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/apexActionController.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/apexActionController.ts @@ -260,7 +260,12 @@ export class ApexActionController { if (jsonObj.ExternalServiceRegistration?.schema) { jsonObj.ExternalServiceRegistration.schema = safeOasSpec; } else { - throw new Error('schema_element_not_found'); + throw new Error(nls.localize('schema_element_not_found')); + } + if (jsonObj.ExternalServiceRegistration?.operations.ExternalServiceOperation) { + jsonObj.ExternalServiceRegistration.operations.ExternalServiceOperation = operations; + } else { + throw new Error(nls.localize('operations_element_not_found')); } } else { // Create a new XML structure diff --git a/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts index d106baf7f0..735ea09128 100644 --- a/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts @@ -101,6 +101,7 @@ export const messages = { registry_access_failed: 'Failed to retrieve ESR directory name from the registry.', full_path_failed: 'Failed to determine the full path for the OpenAPI document.', schema_element_not_found: 'The element was not found in the provided XML.', + operations_element_not_found: 'The element was not found in the provided XML.', error_retrieving_org_version: 'Failed to retrieve org version', error_parsing_yaml: 'Error parsing YAML' }; diff --git a/packages/salesforcedx-vscode-apex/src/messages/i18n.ts b/packages/salesforcedx-vscode-apex/src/messages/i18n.ts index de459aefab..e1f1cebe6d 100644 --- a/packages/salesforcedx-vscode-apex/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-apex/src/messages/i18n.ts @@ -121,6 +121,7 @@ export const messages = { registry_access_failed: 'Failed to retrieve ESR directory name from the registry.', full_path_failed: 'Failed to determine the full path for the OpenAPI document.', schema_element_not_found: 'The element was not found in the provided XML.', + operations_element_not_found: 'The element was not found in the provided XML.', error_retrieving_org_version: 'Failed to retrieve org version', error_parsing_yaml: 'Error parsing YAML' };