Skip to content

Commit b583beb

Browse files
committed
fix(admin): remove certificate create on domain setup mobilization
1 parent b7a0a52 commit b583beb

File tree

1 file changed

+1
-23
lines changed
  • clients/packages/admin-client/src/mobilizations/components/FormDomain

1 file changed

+1
-23
lines changed

clients/packages/admin-client/src/mobilizations/components/FormDomain/FormPanel.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,6 @@ export const FormPanel: React.FC<FormPanelProperties> = ({
8989
}
9090
`
9191
);
92-
const [createOrUpdateCertificate] = useMutation(
93-
gql`
94-
mutation ($dns_hosted_zone_id: Int!) {
95-
create_or_update_certificate(dns_hosted_zone_id: $dns_hosted_zone_id) {
96-
id
97-
is_active
98-
domain
99-
dns_hosted_zone_id
100-
}
101-
}
102-
`
103-
);
10492

10593
const onSubmit = async ({ customDomain, isExternalDomain = false }: { customDomain: string, isExternalDomain?: boolean }) => {
10694
try {
@@ -135,18 +123,8 @@ export const FormPanel: React.FC<FormPanelProperties> = ({
135123

136124
const { data: { update_mobilizations_by_pk } } = await updateMobilization({ variables: { id: mobilization.id, customDomain: `www.${customDomain}` } });
137125

138-
// update certificate is the final request because make a fetch customDomains
139-
let certificate;
140-
if (hostedZone?.ns_ok && !isExternalDomain) {
141-
const { data } = await createOrUpdateCertificate({ variables: { dns_hosted_zone_id: hostedZone.id } });
142-
certificate = data?.create_or_update_certificate;
143-
}
144-
145126
updateDomain && updateDomain(
146-
{
147-
...hostedZone,
148-
certificates: certificate ? [certificate] : []
149-
},
127+
{ ...hostedZone },
150128
{ ...mobilization, ...update_mobilizations_by_pk }
151129
);
152130
toast({ title: 'Domínio registrado com sucesso!', status: 'success', isClosable: true });

0 commit comments

Comments
 (0)