Small tweaks

This commit is contained in:
x032205
2025-07-31 00:32:31 -04:00
parent c80fd55a74
commit 149cecd805
2 changed files with 6 additions and 6 deletions

View File

@@ -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}`,

View File

@@ -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<typeof cloudflareConnectionKeys.listWorkersZones>
ReturnType<typeof cloudflareConnectionKeys.listZones>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: cloudflareConnectionKeys.listWorkersZones(connectionId),
queryKey: cloudflareConnectionKeys.listZones(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TCloudflareZone[]>(
`/api/v1/app-connections/cloudflare/${connectionId}/cloudflare-zones`