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



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

  }),
});

// Export hooks for usage in functional components
export const {
    useUpdatePasswordMutation
} = changePasswordMake;
