feat: added render secret sync

This commit is contained in:
Sheen Capadngan
2025-06-13 22:53:35 +08:00
parent f9c012387c
commit 63ccfc40ac
39 changed files with 722 additions and 18 deletions
@@ -0,0 +1,2 @@
export * from "./queries";
export * from "./types";
@@ -0,0 +1,37 @@
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { appConnectionKeys } from "../queries";
import { TRenderService } from "./types";
const renderConnectionKeys = {
all: [...appConnectionKeys.all, "render"] as const,
listServices: (connectionId: string) =>
[...renderConnectionKeys.all, "services", connectionId] as const
};
export const useRenderConnectionListServices = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TRenderService[],
unknown,
TRenderService[],
ReturnType<typeof renderConnectionKeys.listServices>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: renderConnectionKeys.listServices(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TRenderService[]>(
`/api/v1/app-connections/render/${connectionId}/services`
);
return data;
},
...options
});
};
@@ -0,0 +1,4 @@
export type TRenderService = {
id: string;
name: string;
};