23 lines
652 B
JavaScript
23 lines
652 B
JavaScript
|
module.exports = Self => {
|
||
|
Self.remoteMethod('itemShelvingSaleByCollection', {
|
||
|
description: 'Insert sales of the collection in itemShelvingSale',
|
||
|
accessType: 'WRITE',
|
||
|
accepts: [
|
||
|
{
|
||
|
arg: 'id',
|
||
|
type: 'Number',
|
||
|
description: 'The collection id',
|
||
|
http: {source: 'path'}
|
||
|
}
|
||
|
],
|
||
|
http: {
|
||
|
path: `/:id/itemShelvingSaleByCollection`,
|
||
|
verb: 'POST'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
Self.itemShelvingSaleByCollection = async id => {
|
||
|
await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id]);
|
||
|
};
|
||
|
};
|