Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ead0b8aeda |
@@ -187,45 +187,23 @@ export const DomainSetupForm = ({ defaultSubdomain }) => {
|
|||||||
setValidationMessage('');
|
setValidationMessage('');
|
||||||
setShowDnsConfig(false);
|
setShowDnsConfig(false);
|
||||||
|
|
||||||
fetch('/validate-domain', {
|
// Simulate an API call to validate the domain
|
||||||
method: 'POST',
|
setTimeout(() => {
|
||||||
headers: {
|
// Simulate a real domain check - in a real app this would be an API call
|
||||||
'Content-Type': 'application/json',
|
const checkResult = true; // Assume domain is valid for demo
|
||||||
},
|
|
||||||
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);
|
||||||
|
|
||||||
if (checkResult) {
|
if (checkResult) {
|
||||||
setValidationMessage('Domain is valid and registered.');
|
setValidationMessage('Domain is valid and registered.');
|
||||||
setShowDnsConfig(true);
|
setShowDnsConfig(true);
|
||||||
} else {
|
} else {
|
||||||
setValidationMessage('Domain appears to be unregistered or unavailable.');
|
setValidationMessage('Domain appears to be unregistered or unavailable.');
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user