Skip to content

Commit

Permalink
fix: 🐛 Correcao no build dos veiculos genecios quando uma coluna do c…
Browse files Browse the repository at this point in the history
…sv nao esta na configuracao

A API retornava erro caso uma coluna do CSV nao estivesse na configuracao, esse erro foi corrigido para retornar o csv descondirando a coluna
  • Loading branch information
LucasTonetto committed Nov 8, 2021
1 parent 257663e commit 993eb90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
10 changes: 6 additions & 4 deletions dist/models/GeneralVehicle.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ class GeneralVehicle extends Vehicle_1.Vehicle {
this._validationErrorFounded(param, column);
}
}
this._params[param] += `${StringUtils_1.StringUtils.replaceWhiteSpace(
this.csvLine[normalizedColumn],
this.config.spaceSeparator
).toLowerCase()}${this.config.separator}`;
if (this.csvLine[normalizedColumn]) {
this._params[param] += `${StringUtils_1.StringUtils.replaceWhiteSpace(
this.csvLine[normalizedColumn],
this.config.spaceSeparator
).toLowerCase()}${this.config.separator}`;
}
});
if (this._hasValidationError) {
this._params[param] = this._validationErrorMessage + this._errorParams[param].join(' - ');
Expand Down
11 changes: 6 additions & 5 deletions src/ts/models/GeneralVehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ export class GeneralVehicle extends Vehicle {
this._validationErrorFounded(param, column);
}
}

this._params[param] += `${StringUtils.replaceWhiteSpace(
this.csvLine[normalizedColumn],
this.config.spaceSeparator
).toLowerCase()}${this.config.separator}`;
if (this.csvLine[normalizedColumn]) {
this._params[param] += `${StringUtils.replaceWhiteSpace(
this.csvLine[normalizedColumn],
this.config.spaceSeparator
).toLowerCase()}${this.config.separator}`;
}
});
if (this._hasValidationError) {
this._params[param] = this._validationErrorMessage + this._errorParams[param].join(' - ');
Expand Down

0 comments on commit 993eb90

Please sign in to comment.