salix/modules/item/back/methods/item-shelving-sale/itemShelvingSaleByCollectio...

29 lines
866 B
JavaScript
Raw Normal View History

module.exports = Self => {
2023-09-28 11:26:05 +00:00
Self.remoteMethodCtx('itemShelvingSaleByCollection', {
description: 'Insert sales of the collection in itemShelvingSale',
accessType: 'WRITE',
accepts: [
{
arg: 'id',
2023-09-28 06:08:40 +00:00
type: 'number',
description: 'The collection id',
2023-09-28 06:08:40 +00:00
required: true,
http: {source: 'path'}
}
],
http: {
path: `/:id/itemShelvingSaleByCollection`,
verb: 'POST'
}
});
2023-09-28 11:26:05 +00:00
Self.itemShelvingSaleByCollection = async(ctx, id, options) => {
const myOptions = {userId: ctx.req.accessToken.userId};
if (typeof options == 'object')
Object.assign(myOptions, options);
await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id], myOptions);
};
};