Skip to main content

Service Module onSuccess callback improvements

On our service functions, we have now added the arguments passed to the function (arguments passed to .run()) as the second argument for .onSuccess((response, runArgs) => {}) callback so that you can clearly see for what the request is made for/with.


For example, for window.hapi.contract.service.getContractPostingRequirementOptions with types of ContractServiceGetContractPostingRequirementOptionsHandler:

// Our code will make a call to this
window.hapi.contract.service.getContractPostingRequirementOptions.run(
"ID of contract",
"name of the field",
[
{
"key": "term",
"value": "900e55a5-a637-4dc3-b225-8b95aedcd216"
}
]
)

window.hapi.contract.service.getContractPostingRequirementOptions.onSuccess((result, args) => {
console.log('[HAPI]: Success Result of service function', result)
console.log('[HAPI]: Args passed to run function', args)
})