modified method to recieve params
This commit is contained in:
parent
8d2ef655dd
commit
4fefdade69
|
@ -1,5 +1,5 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('collectionMissingTrash', {
|
||||
Self.remoteMethod('collectionMissingTrash', {
|
||||
description: 'Modify the amount of a sale throwing it into faults or trash',
|
||||
accessType: 'WRITE',
|
||||
accepts: [{
|
||||
|
@ -42,9 +42,10 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.collectionMissingTrash = async function missingTrash(saleId, quantity, isTrash, warehouseId, newQuantity) {
|
||||
Self.collectionMissingTrash = async(saleId, quantity, isTrash, warehouseId, newQuantity) => {
|
||||
params = [saleId, quantity, isTrash, warehouseId, newQuantity];
|
||||
const query = `CALL vn.collection_missingTrash(?,?,?,?,?)`;
|
||||
const [result] = await Self.rawSql(query, [saleId.args.saleId, quantity, isTrash, warehouseId, newQuantity]);
|
||||
const [result] = await Self.rawSql(query, [params]);
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue