From 831cf1317404c2c18182ae060c54220b9d6c11cc Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Sun, 25 Feb 2024 17:33:16 -0800 Subject: [PATCH] fix(backend): skip empty lines while csv parsing. (#36) --- backend/src/v1/object-store/object.store.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/v1/object-store/object.store.service.ts b/backend/src/v1/object-store/object.store.service.ts index daeb9b8a..a1ac1ee1 100644 --- a/backend/src/v1/object-store/object.store.service.ts +++ b/backend/src/v1/object-store/object.store.service.ts @@ -41,6 +41,7 @@ export class ObjectStoreService implements OnModuleDestroy, OnModuleInit { return new Promise((resolve, reject) => { Papa.parse(csv, { header: true, + skipEmptyLines: true, complete: (results: any) => { resolve(results.data) }, @@ -94,6 +95,7 @@ export class ObjectStoreService implements OnModuleDestroy, OnModuleInit { const fileStream: any = result?.Body if (fileStream) { this._omrrData = await this.convertCSVToJson(fileStream) + return this._omrrData } } catch (e) {