The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update check name mutation to throw error instead of returning false
Joshen Limdac1b27fb1f3
diff --git a/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx b/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsxindex 7f6e2d5c923..9443c5e59b4 100644--- a/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx+++ b/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx@@ -30,14 +30,7 @@ const CustomDomainActivate = ({ projectRef, customDomain }: CustomDomainActivateconst [isActivateConfirmModalVisible, setIsActivateConfirmModalVisible] = useState(false)const { data: settings } = useProjectApiQuery({ projectRef })- const { mutate: checkCNAMERecord, isLoading: isCheckingRecord } = useCheckCNAMERecordMutation({- onError: () => {- return ui.setNotification({- category: 'error',- message: `Your CNAME record for ${customDomain.hostname} cannot be found - if you've just added the CNAME record, do check back in a bit.`,- })- },- })+ const { mutate: checkCNAMERecord, isLoading: isCheckingRecord } = useCheckCNAMERecordMutation()const { mutate: activateCustomDomain, isLoading: isActivating } = useCustomDomainActivateMutation({onSuccess: () => {diff --git a/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx b/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsxindex 39c64a71d84..67de6800fc3 100644--- a/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx+++ b/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsx@@ -27,14 +27,7 @@ const CustomDomainsConfigureHostname = () => {const { ref } = useParams()const { project } = useProjectContext()- const { mutate: checkCNAMERecord, isLoading: isCheckingRecord } = useCheckCNAMERecordMutation({- onError: (error, variables) => {- return ui.setNotification({- category: 'error',- message: `Your CNAME record for ${variables.domain} cannot be found - if you've just added the CNAME record, do check back in a bit.`,- })- },- })+ const { mutate: checkCNAMERecord, isLoading: isCheckingRecord } = useCheckCNAMERecordMutation()const { mutate: createCustomDomain, isLoading: isCreating } = useCustomDomainCreateMutation()const { data: settings } = useProjectApiQuery({ projectRef: ref })diff --git a/studio/data/custom-domains/check-cname-mutation.ts b/studio/data/custom-domains/check-cname-mutation.tsindex 04c4f67a8fe..62bfcaf7de7 100644--- a/studio/data/custom-domains/check-cname-mutation.ts+++ b/studio/data/custom-domains/check-cname-mutation.ts@@ -27,7 +27,12 @@ export async function checkCNAMERecord({ domain }: CheckCNAMERecordVariables) {})const verification = (await res.json()) as CheckCNAMERecordResponse- if (verification.Answer === undefined) return false+ if (verification.Answer === undefined) {+ throw new Error(+ `Your CNAME record for ${domain} cannot be found - if you've just added the record, do check back in a bit.`+ )+ }+return verification.Answer.some((x) => x.type === 5)}