Tarea #601 dialogo de añadir cantidad
This commit is contained in:
parent
569cd60d7b
commit
0926e481ed
|
@ -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]
|
||||
);
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue