import {
  BaseQueryFn,
  createApi,
  FetchArgs,
} from "@reduxjs/toolkit/query/react";
import { API_BASE_URL } from "utils/constants";
import baseQuery from "./baseQuery";

export type ProServerError = {
  data: {
    error: string;
    description: string;
    status: "error";
  };
};
export const baseApi = createApi({
  reducerPath: "baseApi",
  baseQuery: baseQuery({
    baseUrl: API_BASE_URL,
  }) as BaseQueryFn<string | FetchArgs, unknown, ProServerError, {}>,
  tagTypes: [
    "Orders",
    "Order",
    "Menu",
    "Restaurant",
  ],
  keepUnusedDataFor: 240, // Keep data for 60 seconds after component unmounts
  endpoints: () => ({}),
});

export const dummy = [];
