25 lines
606 B
JavaScript
25 lines
606 B
JavaScript
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;
|
|
};
|
|
};
|