The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix exit survey submission error handling
Joshen Lim790b53f9557b
diff --git a/studio/components/interfaces/Billing/ExitSurvey/ExitSurvey.tsx b/studio/components/interfaces/Billing/ExitSurvey/ExitSurvey.tsxindex eae9cdb61a8..251d71a6dfa 100644--- a/studio/components/interfaces/Billing/ExitSurvey/ExitSurvey.tsx+++ b/studio/components/interfaces/Billing/ExitSurvey/ExitSurvey.tsx@@ -103,15 +103,6 @@ const ExitSurvey: FC<Props> = ({ freeTier, subscription, onSelectBack }) => {try {setIsSubmitting(true)- // Submit feedback to Freshdesk- await post(`${API_URL}/feedback/send`, {- projectRef,- subject: 'Subscription cancellation - Exit survey',- tags: ['dashboard-exitsurvey'],- category: 'Billing',- message: generateFeedbackMessage(selectedReasons, downgradeMessage),- })-// Trigger subscription downgradeconst tier = freeTier.prices[0].idconst addons: string[] = []@@ -123,7 +114,7 @@ const ExitSurvey: FC<Props> = ({ freeTier, subscription, onSelectBack }) => {})if (res?.error) {- ui.setNotification({+ return ui.setNotification({category: 'error',message: `Failed to cancel subscription: ${res?.error?.message}`,error: res.error,@@ -143,11 +134,21 @@ const ExitSurvey: FC<Props> = ({ freeTier, subscription, onSelectBack }) => {router.push(`/project/${projectRef}`)} else {setIsSuccessful(true)- setIsSubmitting(false)}}++ // Submit feedback to Freshdesk+ const feedbackRes = await post(`${API_URL}/feedback/send`, {+ projectRef,+ subject: 'Subscription cancellation - Exit survey',+ tags: ['dashboard-exitsurvey'],+ category: 'Billing',+ message: generateFeedbackMessage(selectedReasons, downgradeMessage),+ })+ if (feedbackRes.error) throw feedbackRes.error} catch (error: any) {ui.setNotification({ category: 'error', message: `Failed to cancel subscription: ${error}` })+ } finally {setIsSubmitting(false)}}