Spaces:
Running
Running
| import { useQuery } from "@tanstack/react-query"; | |
| import { | |
| getLogs, | |
| } from "./logsApi"; | |
| import { GetLogsRequestParams } from "./types"; | |
| export const useGetLogs = (params: GetLogsRequestParams) => { | |
| return useQuery({ | |
| queryKey: ["logs", params], | |
| queryFn: async () => { | |
| const response = await getLogs(params); | |
| return response; | |
| }, | |
| enabled: !!params | |
| }); | |
| }; |