Connecting to AirTable API using the AirTable npm package

I am trying to connect to the AirTable API using the AirTable npm package. Need help in writing the get request to fetch the data and also writing the bindings for some of the functions.

1 Like

Hi @shrey26
PlayGround this might help I guess.

2 Likes

Hi,
thanks for the reply but I am getting an error message UnhandledPromiseRejectionWarning.

Yeah I missed adding catch for the promise.

Can you look at this playground.

getResults(table)
|> Js.Promise.then_(results => {
  Js.log(results)
  Js.Promise.resolve()
})
|> Js.Promise.catch(error => {
  Js.log(error)
  Js.Promise.resolve()
})
|> ignore
1 Like