From 149cecd80565347082b2c55a27d5a83b65dd7883 Mon Sep 17 00:00:00 2001 From: x032205 Date: Thu, 31 Jul 2025 00:32:31 -0400 Subject: [PATCH] Small tweaks --- .../certificate-authority/acme/dns-providers/cloudflare.ts | 6 +++--- .../src/hooks/api/appConnections/cloudflare/queries.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/services/certificate-authority/acme/dns-providers/cloudflare.ts b/backend/src/services/certificate-authority/acme/dns-providers/cloudflare.ts index 0171b24b7..f4b12e657 100644 --- a/backend/src/services/certificate-authority/acme/dns-providers/cloudflare.ts +++ b/backend/src/services/certificate-authority/acme/dns-providers/cloudflare.ts @@ -16,7 +16,7 @@ export const cloudflareInsertTxtRecord = async ( try { await request.post( - `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${hostedZoneId}/dns_records`, + `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(hostedZoneId)}/dns_records`, { type: "TXT", name: domain, @@ -60,7 +60,7 @@ export const cloudflareDeleteTxtRecord = async ( try { const listRecordsResponse = await request.get<{ result: { id: string; type: string; name: string; content: string }[]; - }>(`${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${hostedZoneId}/dns_records`, { + }>(`${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(hostedZoneId)}/dns_records`, { headers: { Authorization: `Bearer ${apiToken}`, "Content-Type": "application/json", @@ -82,7 +82,7 @@ export const cloudflareDeleteTxtRecord = async ( if (recordToDelete) { await request.delete( - `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${hostedZoneId}/dns_records/${recordToDelete.id}`, + `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(hostedZoneId)}/dns_records/${recordToDelete.id}`, { headers: { Authorization: `Bearer ${apiToken}`, diff --git a/frontend/src/hooks/api/appConnections/cloudflare/queries.tsx b/frontend/src/hooks/api/appConnections/cloudflare/queries.tsx index c0eb75c19..973943d1e 100644 --- a/frontend/src/hooks/api/appConnections/cloudflare/queries.tsx +++ b/frontend/src/hooks/api/appConnections/cloudflare/queries.tsx @@ -11,7 +11,7 @@ const cloudflareConnectionKeys = { [...cloudflareConnectionKeys.all, "pages-projects", connectionId] as const, listWorkersScripts: (connectionId: string) => [...cloudflareConnectionKeys.all, "workers-scripts", connectionId] as const, - listWorkersZones: (connectionId: string) => + listZones: (connectionId: string) => [...cloudflareConnectionKeys.all, "zones", connectionId] as const }; @@ -72,13 +72,13 @@ export const useCloudflareConnectionListZones = ( TCloudflareZone[], unknown, TCloudflareZone[], - ReturnType + ReturnType >, "queryKey" | "queryFn" > ) => { return useQuery({ - queryKey: cloudflareConnectionKeys.listWorkersZones(connectionId), + queryKey: cloudflareConnectionKeys.listZones(connectionId), queryFn: async () => { const { data } = await apiRequest.get( `/api/v1/app-connections/cloudflare/${connectionId}/cloudflare-zones`