34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
|
function insertShelving(shelving, level){
|
||
|
const config = require('./config');
|
||
|
const got = require('got');
|
||
|
(async() => {
|
||
|
const info = await config.info
|
||
|
let key = info.data.token
|
||
|
let currentUser = info.data.currentUser;
|
||
|
(async() => {
|
||
|
const { body } = await got.post('http://app.etiquetaselectronicas.com:9999/item/batchImportItem', {
|
||
|
json: {
|
||
|
agencyId: currentUser.agencyId,
|
||
|
merchantId: currentUser.merchantId,
|
||
|
storeId: currentUser.storeId,
|
||
|
unitName: currentUser.unitName,
|
||
|
itemList: [
|
||
|
{
|
||
|
attrCategory: "verdnatura",
|
||
|
attrName: "sinTicket",
|
||
|
barCode: shelving + level,//Matricula + nivel
|
||
|
itemTitle: "Etiqueta Sin ticket",
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
responseType: 'json',
|
||
|
headers: {
|
||
|
"Authorization": key
|
||
|
}
|
||
|
})
|
||
|
console.log(body)
|
||
|
})();
|
||
|
})();
|
||
|
}
|
||
|
|
||
|
exports.insertShelving = insertShelving;
|