From 845dcb242ae47f8c52220060b1aae012d6c6a210 Mon Sep 17 00:00:00 2001 From: Alex H Date: Fri, 14 Apr 2023 19:07:32 -0400 Subject: [PATCH] renamed 4 variables to better describe what they're for, fixed if logic --- ui/src/router/views/import-generic.vue | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ui/src/router/views/import-generic.vue b/ui/src/router/views/import-generic.vue index eda5fd8..abcad73 100644 --- a/ui/src/router/views/import-generic.vue +++ b/ui/src/router/views/import-generic.vue @@ -26,11 +26,11 @@ export default { fileHeadings: null, myVehicles: [], selectedVehicle: null, - invert: false, - filledValue: null, - notFilledValue: null, + invertFullTank: false, + filledValueString: null, + notFilledValueString: null, isFullTankString: false, - fillupModel: { + fileHeadingMap: { fuelQuantity: null, perUnitPrice: null, totalAmount: null, @@ -79,9 +79,9 @@ export default { Papa.parse(this.file, this.papaConfig) }, importData() { - if (this.errors.length !== 0) { + if (this.errors.length === 0) { const content = { - headings: this.fillupModel, + headings: this.fileHeadingMap, data: this.fileData.splice(1, this.fileData.length), fullTankInverted: this.inverted, vehicleId: this.selectedVehicle.id, @@ -92,7 +92,7 @@ export default { } }, checkFieldString() { - const tankFull = this.fileData[1][this.fillupModel.isTankFull] + const tankFull = this.fileData[1][this.fileHeadingMap.isTankFull] if (typeof tankFull !== 'boolean') { if (typeof tankFull === 'string' && tankFull.length > 0) { this.isFullTankString = true @@ -172,35 +172,35 @@ export default { - + - + - + - + - + - + - {{ $t('fulltank') }} - {{ $t('partialfillup') }} + {{ $t('fulltank') }} + {{ $t('partialfillup') }} - + @@ -227,28 +227,28 @@ export default { - + - + - + - + - +