Skip to content

Commit

Permalink
fix: update status of unconfigured IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
gloriateodoro committed Jun 21, 2022
1 parent 387438e commit 82f5cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const CertificateStatus: React.FC<Properties> = ({ updateDomain, customDo
)[0];
const hasCertificate = domain?.certificates[0]?.is_active
const isExternalDomain = domain?.is_external_domain
const failedIp = !domain?.ns_ok && isExternalDomain
const failedIp = (!domain?.ns_ok && isExternalDomain) || (domain === undefined)
const toast = useToast()

const [updateDnsHostedZone] = useMutation(
Expand Down Expand Up @@ -94,7 +94,7 @@ export const CertificateStatus: React.FC<Properties> = ({ updateDomain, customDo
)}

{/* GERANDO CERTIFICADO */}
{customDomain && domain.ns_ok && !domain?.certificates[0]?.is_active && (
{customDomain && domain?.ns_ok && !domain?.certificates[0]?.is_active && (
<>
<Flex >
<LoadingIcon />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const FormPanel: React.FC<FormPanelProperties> = ({
const onSubmit = async ({ customDomain, isExternalDomain = false }: { customDomain: string, isExternalDomain?: boolean }) => {
try {
const hostedZone = internalHostedZones.filter((hz) => customDomain.endsWith(hz.domain_name))[0];
if (isExternalDomain) {
if (isExternalDomain && mobilization.community_id) {
// Create dns hosted zone
const { data } = await createDnsHostedZone({
variables: {
Expand All @@ -127,7 +127,7 @@ export const FormPanel: React.FC<FormPanelProperties> = ({
}
} else {
if (!hostedZone?.ns_ok) {
if (await checkDNS(customDomain, 'NS', { ns: hostedZone.name_servers })) {
if (await checkDNS(customDomain, 'NS', { ns: hostedZone?.name_servers })) {
await updateDnsHostedZone({ variables: { id: hostedZone.id } })
}
}
Expand Down

0 comments on commit 82f5cf0

Please sign in to comment.