import { createApi } from "@reduxjs/toolkit/query/react";
import { baseQueryWithReauth } from "./apiSlice";
import { TermsAndConditionsResponse } from "../../Types/termsAndConditionTypes";

export const TermsAndCondition = createApi({
    reducerPath: "TermsAndCondition",
    baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
    endpoints: (builder) => ({
      getTermsAndCondition: builder.query<TermsAndConditionsResponse, void>({
        query: () => "/term-and-condition",
      }),
    }),
});

// Correctly export the hook
export const { useGetTermsAndConditionQuery } = TermsAndCondition;
