// investorDetails.service.js
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
// import { api } from "./api.service";
import { baseQuery } from "./token.serivce";

// const baseUrl = api?.defaults.baseURL;

// Define a service using a base URL and expected endpoints
export const fawateerMaker = createApi({
  reducerPath: "fawateerMaker",
  baseQuery: baseQuery,
  tagTypes: [""],

  endpoints: (builder) => ({



    getBank: builder.query({
      query: ({ page, size }) =>
        `/bankDetails/admin/?page=${page}&size=${size}`,
      providesTags: ["getBank"],
    }),

    updateBankDetails: builder.mutation({
      query: ({ data, id }) => ({
        url: `/bankDetails/admin/${id}`,
        method: "PATCH",
        body: data,
      }),
      invalidatesTags: ["getBank"],
    }),

    createFawateerRequest: builder.mutation({
        query: ({ data, id }) => ({
          url: `/fawateer/admin/${id}`,
          method: "POST",
          body: data,
        }),
        invalidatesTags: [""],
      }),




    
  }),
});

// Export hooks for usage in functional components
export const { 
    useCreateFawateerRequestMutation
} = fawateerMaker;
