salix/services/loopback/common/methods/item/getDiary.js

25 lines
606 B
JavaScript
Raw Normal View History

module.exports = Self => {
Self.remoteMethod('getDiary', {
description: 'Returns the ',
accessType: 'READ',
accepts: [{
arg: 'params',
type: 'object',
description: 'itemFk, warehouseFk'
}],
returns: {
arg: 'diary',
root: true
},
http: {
path: `/getDiary`,
verb: 'GET'
}
});
Self.getDiary = async params => {
let [diary] = await Self.rawSql(`CALL vn.itemDiary(?, ?)`, [params.itemFk, params.warehouseFk]);
return diary;
};
};