salix/back/methods/collection/collectionFaults.js

36 lines
980 B
JavaScript
Raw Normal View History

2020-03-23 12:26:45 +00:00
module.exports = Self => {
Self.remoteMethodCtx('collectionFaults', {
description: 'Update sale of a collection',
accessType: 'WRITE',
accepts: [{
arg: 'shelvingFk',
type: 'Number',
required: true,
description: 'The sale id'
}, {
arg: 'quantity',
type: 'Number',
required: true,
description: 'The quantity to sale'
}, {
arg: 'itemFk',
type: 'Number',
required: true,
description: 'The ticket id'
}],
returns: {
type: 'Object',
root: true
},
http: {
path: `/collectionFaults`,
verb: 'POST'
}
});
Self.collectionFaults = async(ctx, shelvingFk, quantity, itemFk) => {
query = `vn.collection_faults(?,?,?)`;
return await Self.rawSql(query, [shelvingFk, quantity, itemFk]);
};
};