import { getEduConnectAccessToken } from "./token.helper"

export const fetchHeader = () => {
  return(
    {
      Authorization : `Bearer ${getEduConnectAccessToken()}`,
      Accept : 'Application/json'
    }
  )
}


export const defaultFetcher = async (url : string) : Promise<Record<string,[] | Record<string,any>> | any> => {
  const res = await fetch(url , {
      headers : {
          Authorization : `Bearer ${getEduConnectAccessToken()}`,
          Accept : 'application/json'
      }
  })
  return res.json();
}