
// Need to use the React-specific entry point to import createApi
import { createApi} from "@reduxjs/toolkit/query/react";
import { baseQuery } from "./token.serivce";



// Define a service using a base URL and expected endpoints
export const forgetPasswordMake = createApi({
  reducerPath: "forgetPassword",
  baseQuery: baseQuery,
  tagTypes: ["getPassword"],
  endpoints: (builder) => ({
    // // ========[ update ]========
    forgetPassword: builder.mutation({
      query: (data) => ({
        url: `/auth/admin/forget-password`,
        method: "POST",
        body: data,
      }),
      invalidatesTags: ["getPassword"],
    }),

  }),
});

// Export hooks for usage in functional components
export const {
    useForgetPasswordMutation
} = forgetPasswordMake;
