use await Promise.all in uploadedFile Product
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 6s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 6s
This commit is contained in:
parent
05d16f22de
commit
e42b772dcf
1 changed files with 27 additions and 26 deletions
|
|
@ -518,8 +518,9 @@ export class ProductController extends Controller {
|
||||||
async (tx) => {
|
async (tx) => {
|
||||||
const branch = productGroup.registeredBranch;
|
const branch = productGroup.registeredBranch;
|
||||||
const company = (branch.headOffice || branch).code;
|
const company = (branch.headOffice || branch).code;
|
||||||
console.log(branch, company);
|
|
||||||
for (const item of data) {
|
await Promise.all(
|
||||||
|
data.map(async (item) => {
|
||||||
const dataDuplicate = productSameName.some(
|
const dataDuplicate = productSameName.some(
|
||||||
(v) => v.code.slice(0, -3) === item.code.toUpperCase() && v.name === item.name,
|
(v) => v.code.slice(0, -3) === item.code.toUpperCase() && v.name === item.name,
|
||||||
);
|
);
|
||||||
|
|
@ -544,8 +545,8 @@ export class ProductController extends Controller {
|
||||||
productGroupId: productGroupId,
|
productGroupId: productGroupId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}),
|
||||||
console.log("dataProduct", dataProduct);
|
);
|
||||||
|
|
||||||
return await prisma.product.createManyAndReturn({
|
return await prisma.product.createManyAndReturn({
|
||||||
data: dataProduct,
|
data: dataProduct,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue