I'm trying to check if the result from an api calls returns anything and based on that do some other actions but the following code always go through the process_result() function even though the result is an empty object, can anyone see what I'm doing wrong,
RemoteApi.api_request(server, method, url, data)
.then(result => {
debug("result from API request: ", result)
debug("data from API request: ", data)
if (result !== {}) {
debug("in process result now")
process_result(result, label, model, dispatchOptions)
.then(body => {
onSuccess(body)
})
.catch(error => {
onFailure(error)
})
} else {
debug("outside process result now")
}
})
.catch(error => onFailure(error))