From ceee601e135d27a3b1a8cbd33f34e90702d18fe9 Mon Sep 17 00:00:00 2001 From: Stuart Long Chay Boon Date: Thu, 3 Nov 2022 21:23:16 +0800 Subject: [PATCH] [offers][feat] normalise sheet to incorporate slug --- apps/portal/prisma/readSheet.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/portal/prisma/readSheet.ts b/apps/portal/prisma/readSheet.ts index 01302fd9..20d1edd8 100644 --- a/apps/portal/prisma/readSheet.ts +++ b/apps/portal/prisma/readSheet.ts @@ -31,7 +31,7 @@ type ExcelData = { const sheets = file.SheetNames; -for (let i = 0; i < sheets.length; i++) { +for (let i = 0; i < 1; i++) { const temp = reader.utils.sheet_to_json(file.Sheets[file.SheetNames[i]]); temp.forEach((res: ExcelData) => { data.push(res); @@ -112,7 +112,7 @@ const seedSalaries = async () => { const companyIdMappings = {}; (await prisma.company.findMany()).forEach((company) => { - companyIdMappings[company.name] = company.id; + companyIdMappings[company.slug] = company.id; }); // get countryId of Singapore @@ -122,7 +122,7 @@ const seedSalaries = async () => { } })) - // console.log(singapore) + console.log("Singapore ID: " + singapore) // break; // seed here