Tarea #601 dialogo de añadir cantidad

This commit is contained in:
gerard 2018-09-14 14:44:46 +02:00
parent 569cd60d7b
commit 0926e481ed
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
module.exports = Self => {
Self.remoteMethod('new', {
description: 'Creates rows (lines) for a order',
accessType: 'WRITE',
accepts: [{
arg: 'params',
type: 'object',
required: true,
description: 'order id, item id, warehouse, quantity',
http: {source: 'body'}
}],
returns: {
type: 'object',
root: true
},
http: {
path: `/new`,
verb: 'POST'
}
});
Self.new = async params => {
return await Self.rawSql(
`CALL vn.orderAddItem(?, ?, ?, ?)`,
[params.warehouseFk, params.itemFk, params.quantity, params.orderFk]
);
};
};