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 feedback submission error handling and response structure in feedback-modal.ejs. Return detailed error messages on failure and ensure success checks before displaying success toast.

Salman-Ahamed2a3339139437
diff --git a/packages/app/views/pages/partials/studio/feedback-modal.ejs b/packages/app/views/pages/partials/studio/feedback-modal.ejs
index 31309de8..63f25e6e 100644
--- a/packages/app/views/pages/partials/studio/feedback-modal.ejs
+++ b/packages/app/views/pages/partials/studio/feedback-modal.ejs
@@ -200,10 +200,11 @@
throw new Error('Failed to submit feedback');
}
- return response.json();
+ const result = await response.json();
+ return result;
} catch (error) {
console.error('Error submitting feedback:', error);
- return null;
+ return { success: false, error: error.message };
}
}
@@ -263,9 +264,8 @@
setLoadingState(false);
- if (result) {
+ if (result && result.success) {
toast?.('Thank you for your feedback!', 'Success', 'success');
- console.log('Feedback submitted successfully to HubSpot');
closeFeedbackModal();
} else {
toast?.('Failed to submit feedback. Please try again.', 'Error', 'alert');