I have encountered a situation that is similar to the one described in this post, but I am still unsure about how to implement it. I could use some assistance with setting up a successful callback.
This is the current functioning code:
function getStuff(accountNumber) {
var logMessage = 'POST GetStuff';
return $http.post(GetStuff, { custId: accountNumber })
.then(log);
}
function log(response) {
logger.debug(response);
return response;
}
This is my desired goal:
function getStuff(accountNumber) {
var logMessage = 'POST GetStuff';
return $http.post(GetStuff, { custId: accountNumber })
.then(log(response, logMessage));
}
function log(response, logMessage) {
logger.debug(logMessage, response);
return response;
}