From 137737e4c215f5a9a6aae78cafbefe5b4cf7793d Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 6 Feb 2025 11:27:03 +0700 Subject: update scanner and add value --- src/app/api/product/import/route.tsx | 3 ++- src/common/components/Scanner/index.tsx | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/app/api/product/import/route.tsx b/src/app/api/product/import/route.tsx index 3f11def..37b4690 100644 --- a/src/app/api/product/import/route.tsx +++ b/src/app/api/product/import/route.tsx @@ -25,7 +25,8 @@ export async function POST(request: NextRequest) { onhandQty: row[3] || 0, // Handle undefined values differenceQty: row[4] || 0, // Handle undefined values companyId: intCompanyId, // Use the parsed company ID - externalId: row[6] ? row[6].toString() : null // Handle undefined values + externalId: row[6] ? row[6].toString() : null, // Handle undefined values + value: row[7] != null ? Number(row[7]) || 0 : null, })); const whereCompany = { companyId: intCompanyId } diff --git a/src/common/components/Scanner/index.tsx b/src/common/components/Scanner/index.tsx index 56d2495..c21633f 100644 --- a/src/common/components/Scanner/index.tsx +++ b/src/common/components/Scanner/index.tsx @@ -29,10 +29,9 @@ const Scanner = (props: Props) => { } return ( -
-