added api
parent
0900d51954
commit
f9d1556ce9
|
@ -187,10 +187,25 @@ export const DomainSetupForm = ({ defaultSubdomain }) => {
|
||||||
setValidationMessage('');
|
setValidationMessage('');
|
||||||
setShowDnsConfig(false);
|
setShowDnsConfig(false);
|
||||||
|
|
||||||
// Simulate an API call to validate the domain
|
fetch('/validate-domain', {
|
||||||
setTimeout(() => {
|
method: 'POST',
|
||||||
// Simulate a real domain check - in a real app this would be an API call
|
headers: {
|
||||||
const checkResult = true; // Assume domain is valid for demo
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
domain,
|
||||||
|
type: domainType
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Network response was not ok');
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
const checkResult = data.status === "success";
|
||||||
|
console.log("finding:: checkResult:: ", checkResult, data);
|
||||||
|
|
||||||
setIsValidating(false);
|
setIsValidating(false);
|
||||||
setIsValidDomain(checkResult);
|
setIsValidDomain(checkResult);
|
||||||
|
@ -203,7 +218,14 @@ export const DomainSetupForm = ({ defaultSubdomain }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
validateForm();
|
validateForm();
|
||||||
}, 1500);
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error validating domain:', error);
|
||||||
|
setIsValidating(false);
|
||||||
|
setIsValidDomain(false);
|
||||||
|
setValidationMessage('Error checking domain. Please try again.');
|
||||||
|
validateForm();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check DNS configuration
|
// Check DNS configuration
|
||||||
|
|
Loading…
Reference in New Issue