import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
import { RootState } from '../store'

const baseURL = import.meta.env.VITE_API_BASE_URL

export const noAuth = createApi({
    reducerPath: 'noAuth',
    baseQuery: fetchBaseQuery({
        baseUrl: baseURL,
        prepareHeaders: (headers, { getState }) => {
        //   const token = (getState() as RootState).auth.token
        //   if (token) {
        //     headers.set('authorization', `Bearer ${token}`)
        //   }
            return headers
        },
    }),
    endpoints: () => ({}),
})