I try to make a custom endpoint, which adds a bonus to all employee. And retorns all the employee records, just like the get endpoint.
Something like /employees/bonus
As I understand; I should make a remote method for this:
common/models/employee.js
Employee.bonus = function(cb){
// logic comes here
cb(null,"")
}
Employee.remoteMethod(
'bonus',{}
)
This makes the endpoint, but how can request all the employees, to loop them through and increase their salary property?