export default async function postgrestHelper(event: any, url: string, method: string = 'GET', body: any) {
  const config = useRuntimeConfig()

  let options: any = {}
  if(body) {
    options = {
      ...options,
      body: body
    }
  }
  
  return await $fetch(config.api.postgrest+'/'+url, {
    method: method,
    ...options
  })
}
