import { useQuery } from "react-query"; import { useHttp } from "@/hooks/useHttp"; interface IAgreementResponse { errors: any[]; warnings: any[]; informations: any[]; success: boolean; result: Agreement; } export interface Agreement { agreements: Result[]; } export interface Result { agreementId: number; typeValue: number; type: string; body: string; updateDate: string; scopePath: string; } export const useAgreementQuery = () => { const http = useHttp("eva-panel-api"); const service = () => http .get("/api/agreement?culture=tr-TR&v=2") .then((res) => res.data); return useQuery({ queryFn: service, queryKey: "agreement", }); };