import { fetchBaseQuery } from '@reduxjs/toolkit/query/react';

const rawBaseQuery = fetchBaseQuery({
  baseUrl: 'http://localhost:3000/api',
});

const baseQueryWithReauth = async (args: any, api: any, extraOptions: any) => {
  const result = await rawBaseQuery(args, api, extraOptions);

  // Optional: reauthentication logic if result.error?.status === 401

  return result;
};

export default baseQueryWithReauth;
