From b583bebb2791cb5a373e91dfe599fc99e42eb783 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Mon, 13 Jan 2025 14:26:01 -0300 Subject: [PATCH] fix(admin): remove certificate create on domain setup mobilization --- .../components/FormDomain/FormPanel.tsx | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/clients/packages/admin-client/src/mobilizations/components/FormDomain/FormPanel.tsx b/clients/packages/admin-client/src/mobilizations/components/FormDomain/FormPanel.tsx index f378497257..c2a6ac2ef8 100644 --- a/clients/packages/admin-client/src/mobilizations/components/FormDomain/FormPanel.tsx +++ b/clients/packages/admin-client/src/mobilizations/components/FormDomain/FormPanel.tsx @@ -89,18 +89,6 @@ export const FormPanel: React.FC = ({ } ` ); - const [createOrUpdateCertificate] = useMutation( - gql` - mutation ($dns_hosted_zone_id: Int!) { - create_or_update_certificate(dns_hosted_zone_id: $dns_hosted_zone_id) { - id - is_active - domain - dns_hosted_zone_id - } - } - ` - ); const onSubmit = async ({ customDomain, isExternalDomain = false }: { customDomain: string, isExternalDomain?: boolean }) => { try { @@ -135,18 +123,8 @@ export const FormPanel: React.FC = ({ const { data: { update_mobilizations_by_pk } } = await updateMobilization({ variables: { id: mobilization.id, customDomain: `www.${customDomain}` } }); - // update certificate is the final request because make a fetch customDomains - let certificate; - if (hostedZone?.ns_ok && !isExternalDomain) { - const { data } = await createOrUpdateCertificate({ variables: { dns_hosted_zone_id: hostedZone.id } }); - certificate = data?.create_or_update_certificate; - } - updateDomain && updateDomain( - { - ...hostedZone, - certificates: certificate ? [certificate] : [] - }, + { ...hostedZone }, { ...mobilization, ...update_mobilizations_by_pk } ); toast({ title: 'Domínio registrado com sucesso!', status: 'success', isClosable: true });