import { createApi } from "@reduxjs/toolkit/query/react";
import { baseQueryWithReauth } from "./apiSlice"; // Ensure this is correctly configured
import { PrivacyPolicyResponse } from "../../Types/privacyPolicyTypes";

export const privacyPolicy = createApi({
  reducerPath: "privacyPolicy",
  baseQuery: baseQueryWithReauth, // Ensure this returns a valid `BaseQueryFn`
  endpoints: (builder) => ({
    getPrivacyPolicy: builder.query<PrivacyPolicyResponse, void>({ // Fix types here
      query: () => "/privacy-policy",
    }),
  }),
});

// Export hook
export const { useGetPrivacyPolicyQuery } = privacyPolicy;
