Looking to customize the remote method find in Loopback, I attempted the following approach in my model:
'usestrict';
module.exports = function(Movimenti) {
Movimenti.once('attached', function(obj) {
Movimenti.find = function(filter, empty, cb) {
cb(null, this.find({
"where": {
"mov_utente_fk": 2
}
}));
}
});
};
However, running into an error:
500 Maximum call stack size exceeded
Any assistance with resolving this issue would be greatly appreciated!