From 7545f6f7d09853977b2d1d647b642e0a70a1c5f3 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:24:23 +0200 Subject: [PATCH] refactor: clarify description import (#526) --- apps/server/src/utils/parser.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/server/src/utils/parser.ts b/apps/server/src/utils/parser.ts index 61e944eb2..260bab21b 100644 --- a/apps/server/src/utils/parser.ts +++ b/apps/server/src/utils/parser.ts @@ -70,8 +70,9 @@ export const parseExcel = async (excelData) => { excelData .filter((e) => e.length > 0) .forEach((row) => { - let eventTitleNext = false; + // project data imports are on the column to the right let projectTitleNext = false; + let projectDescriptionNext = false; let publicUrlNext = false; let publicInfoNext = false; let backstageUrlNext = false; @@ -81,12 +82,12 @@ export const parseExcel = async (excelData) => { row.forEach((column, j) => { // check flags - if (eventTitleNext) { + if (projectTitleNext) { projectData.title = column; - eventTitleNext = false; - } else if (projectTitleNext) { - projectData.description = column; projectTitleNext = false; + } else if (projectDescriptionNext) { + projectData.description = column; + projectDescriptionNext = false; } else if (publicUrlNext) { projectData.publicUrl = column; publicUrlNext = false; @@ -159,10 +160,10 @@ export const parseExcel = async (excelData) => { // need to make sure it is a string first switch (col) { case 'project name': - eventTitleNext = true; + projectTitleNext = true; break; case 'project description': - projectTitleNext = true; + projectDescriptionNext = true; break; case 'public url': publicUrlNext = true;