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

import { FetchTags } from './tags';

const baseQuery = fetchBaseQuery({
  baseUrl: process.env.TAYLOR_API_ENDPOINT,
  headers: {
    Authorization: process.env.TAYLOR_API_TOKEN || '',
    schema: 'readable',
  },
  next: {
    tags: [FetchTags.TAYLOR],
  },
});

export const taylorAPI = createApi({
  reducerPath: 'taylorAPI',
  baseQuery,
  endpoints: () => ({}),
});
