Skip to content

Commit

Permalink
fix(backend): skip empty lines while csv parsing. (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp authored Feb 26, 2024
1 parent 7ed9a9c commit 831cf13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/src/v1/object-store/object.store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 831cf13

Please sign in to comment.