Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Enhance endpoint formatting and unsaved changes detection in APIEndpoint component

Muhammad Hamza Khan21ef0cb1bbe7
diff --git a/packages/app/src/builder-ui/components/APIEndpoint.class.ts b/packages/app/src/builder-ui/components/APIEndpoint.class.ts
index b79d34f6..dc4989e7 100644
--- a/packages/app/src/builder-ui/components/APIEndpoint.class.ts
+++ b/packages/app/src/builder-ui/components/APIEndpoint.class.ts
@@ -422,11 +422,18 @@ export class APIEndpoint extends Component {
// Ensure endpoint value is properly formatted
if (settingsValues.endpoint) {
// Format according to validation rules (trim and replace spaces with underscores)
- this.data.endpoint = getValidEndpoint(settingsValues.endpoint);
+ const formattedEndpoint = getValidEndpoint(settingsValues.endpoint);
+ this.data.endpoint = formattedEndpoint;
// Also update endpointLabel to match
this.data.endpointLabel = this.data.endpoint;
+ // Update the form field value to match the formatted value to prevent unsaved changes detection
+ const endpointField = document.querySelector('input[name="endpoint"]') as HTMLInputElement;
+ if (endpointField) {
+ endpointField.value = formattedEndpoint;
+ }
+
// Update endpointLabel to match the formatted endpoint value
const endpointLabel = document.querySelector(
'div[name="endpointLabel"]',