This commit is contained in:
parent
75e54bd82f
commit
e51df063d3
|
@ -1,5 +1,5 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('itemShelvingSaleByCollection', {
|
||||
Self.remoteMethodCtx('itemShelvingSaleByCollection', {
|
||||
description: 'Insert sales of the collection in itemShelvingSale',
|
||||
accessType: 'WRITE',
|
||||
accepts: [
|
||||
|
@ -17,7 +17,12 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.itemShelvingSaleByCollection = async id => {
|
||||
await Self.rawSql(`CALL vn.itemShelvingSale_addByCollection(?)`, [id]);
|
||||
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);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('itemShelvingSaleSetQuantity', {
|
||||
Self.remoteMethodCtx('itemShelvingSaleSetQuantity', {
|
||||
description: 'Set quanitity of a sale in itemShelvingSale',
|
||||
accessType: 'WRITE',
|
||||
accepts: [
|
||||
|
@ -28,7 +28,14 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.itemShelvingSaleSetQuantity = async(id, quantity, isItemShelvingSaleEmpty) => {
|
||||
await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`, [id, quantity, isItemShelvingSaleEmpty]);
|
||||
Self.itemShelvingSaleSetQuantity = async(ctx, id, quantity, isItemShelvingSaleEmpty, options) => {
|
||||
const myOptions = {userId: ctx.req.accessToken.userId};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
await Self.rawSql(`CALL vn.itemShelvingSale_setQuantity(?, ?, ? )`,
|
||||
[id, quantity, isItemShelvingSaleEmpty],
|
||||
myOptions);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue