import { createApi } from "@reduxjs/toolkit/query/react";
import baseQueryWithReauth from "./baseQuery";

export const sercicesApi = createApi({
  reducerPath: "sercicesApi",
  baseQuery: baseQueryWithReauth,
  tagTypes: ["services"],
  endpoints: (builder) => ({
    // GET services LIST

    getServiceList: builder.query<any, { service_type: string }>({
      query: ({ service_type }) => ({
        url: `/admin/service-page/list`,
        params: { service_type },
      }),
    }),
  }),
});

export const { useGetServiceListQuery } = sercicesApi;
