salix/services/client/common/models/client-credit.js

21 lines
533 B
JavaScript
Raw Normal View History

module.exports = Self => {
Self.installMethod('filter', filterParams);
2017-12-04 07:17:29 +00:00
function filterParams(params) {
return {
where: {
clientFk: params.clientFk
},
skip: (params.page - 1) * params.size,
limit: params.size,
order: params.order || 'created DESC',
include: {
relation: "worker",
2017-12-04 07:17:29 +00:00
scope: {
fields: ["id", "firstName", "name"]
2017-12-04 07:17:29 +00:00
}
}
};
}
};