So I have the following function
let searchBike = (serialNumber: string) =>
Fetch.fetchWithInit(
`http://localhost:8000/bikes/search?serialNumber=${serialNumber}`,
Fetch.RequestInit.make(~method_=Get, ()),
)
->Js.Promise.then_(Fetch.Response.json, _)
->Js.Promise.then_(obj => {
obj->Decode.bikeData->Js.Promise.resolve
}, _)
Ho do I act if response is not 200?
Whenever I try to check the code, compiler says that there is no status
field in the response.