mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 21:27:31 +00:00
Small tweaks
This commit is contained in:
@@ -16,7 +16,7 @@ export const cloudflareInsertTxtRecord = async (
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await request.post(
|
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",
|
type: "TXT",
|
||||||
name: domain,
|
name: domain,
|
||||||
@@ -60,7 +60,7 @@ export const cloudflareDeleteTxtRecord = async (
|
|||||||
try {
|
try {
|
||||||
const listRecordsResponse = await request.get<{
|
const listRecordsResponse = await request.get<{
|
||||||
result: { id: string; type: string; name: string; content: string }[];
|
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: {
|
headers: {
|
||||||
Authorization: `Bearer ${apiToken}`,
|
Authorization: `Bearer ${apiToken}`,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@@ -82,7 +82,7 @@ export const cloudflareDeleteTxtRecord = async (
|
|||||||
|
|
||||||
if (recordToDelete) {
|
if (recordToDelete) {
|
||||||
await request.delete(
|
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: {
|
headers: {
|
||||||
Authorization: `Bearer ${apiToken}`,
|
Authorization: `Bearer ${apiToken}`,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const cloudflareConnectionKeys = {
|
|||||||
[...cloudflareConnectionKeys.all, "pages-projects", connectionId] as const,
|
[...cloudflareConnectionKeys.all, "pages-projects", connectionId] as const,
|
||||||
listWorkersScripts: (connectionId: string) =>
|
listWorkersScripts: (connectionId: string) =>
|
||||||
[...cloudflareConnectionKeys.all, "workers-scripts", connectionId] as const,
|
[...cloudflareConnectionKeys.all, "workers-scripts", connectionId] as const,
|
||||||
listWorkersZones: (connectionId: string) =>
|
listZones: (connectionId: string) =>
|
||||||
[...cloudflareConnectionKeys.all, "zones", connectionId] as const
|
[...cloudflareConnectionKeys.all, "zones", connectionId] as const
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -72,13 +72,13 @@ export const useCloudflareConnectionListZones = (
|
|||||||
TCloudflareZone[],
|
TCloudflareZone[],
|
||||||
unknown,
|
unknown,
|
||||||
TCloudflareZone[],
|
TCloudflareZone[],
|
||||||
ReturnType<typeof cloudflareConnectionKeys.listWorkersZones>
|
ReturnType<typeof cloudflareConnectionKeys.listZones>
|
||||||
>,
|
>,
|
||||||
"queryKey" | "queryFn"
|
"queryKey" | "queryFn"
|
||||||
>
|
>
|
||||||
) => {
|
) => {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: cloudflareConnectionKeys.listWorkersZones(connectionId),
|
queryKey: cloudflareConnectionKeys.listZones(connectionId),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await apiRequest.get<TCloudflareZone[]>(
|
const { data } = await apiRequest.get<TCloudflareZone[]>(
|
||||||
`/api/v1/app-connections/cloudflare/${connectionId}/cloudflare-zones`
|
`/api/v1/app-connections/cloudflare/${connectionId}/cloudflare-zones`
|
||||||
|
|||||||
Reference in New Issue
Block a user