7167-testToMaster_2414 #2244
|
@ -1,31 +0,0 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('getItemPackingType', {
|
||||
description: 'Retrieve the operator items',
|
||||
accessType: 'READ',
|
||||
returns: {
|
||||
type: 'object',
|
||||
},
|
||||
http: {
|
||||
path: `/getItemPackingType`,
|
||||
verb: 'GET'
|
||||
},
|
||||
});
|
||||
|
||||
Self.getItemPackingType = async ctx => {
|
||||
const userId = 9 ?? ctx.req.accessToken.userId;
|
||||
|
||||
const result = await Self.findOne({
|
||||
where: {
|
||||
workerFk: userId
|
||||
},
|
||||
include: {
|
||||
relation: 'itemPackingType',
|
||||
}
|
||||
});
|
||||
const itemPackingType = result.itemPackingType();
|
||||
|
||||
return {
|
||||
description: itemPackingType?.description
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue