refs #4823 Bug fix
This commit is contained in:
parent
9b2f7d12ab
commit
d2e6cab7d3
6
utils.js
6
utils.js
|
@ -452,14 +452,14 @@ export async function insertSupplyLine(supplyLine) {
|
|||
where: { warehouseId: supplyLine.warehouseId }
|
||||
});
|
||||
if (!warehouse) {
|
||||
let warehouse = (await vnRequest('GET', `${env.API_URL}/warehouses/${supplyLine.warehouseId}`, null, null, spinner)).data;
|
||||
let warehouse = (await vnRequest('GET', `${env.API_URL}/warehouses/${supplyLine.warehouseId}`, null, null, null)).data;
|
||||
|
||||
// Check if the organization exists, and if it doesn't, create it
|
||||
let organization = await models.organization.findOne({
|
||||
where: { organizationId: warehouse.organizationId }
|
||||
}, { transaction: tx });
|
||||
if (!organization) {
|
||||
let organization = (await vnRequest('GET', `${env.API_URL}/organizations/${warehouse.organizationId}`, null, null, spinner)).data;
|
||||
let organization = (await vnRequest('GET', `${env.API_URL}/organizations/${warehouse.organizationId}`, null, null, null)).data;
|
||||
await insertOrganization(organization);
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ export async function insertSupplyLine(supplyLine) {
|
|||
where: { tradeItemId: supplyLine.tradeItemId }
|
||||
}, { transaction: tx });
|
||||
if (!tradeItem) {
|
||||
let tradeItem = (await vnRequest('GET', `${env.API_URL}/trade-items/${supplyLine.tradeItemId}`, null, null, spinner)).data;
|
||||
let tradeItem = (await vnRequest('GET', `${env.API_URL}/trade-items/${supplyLine.tradeItemId}`, null, null, null)).data;
|
||||
await insertTradeItem(tradeItem);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue