fixed error in if logic which caused all fields to be returned as true
This commit is contained in:
@@ -16,7 +16,7 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
file: null,
|
file: null,
|
||||||
tryingToCreate: false,
|
tryingToCreate: false,
|
||||||
@@ -118,15 +118,19 @@ export default {
|
|||||||
item[k] = comments(row)
|
item[k] = comments(row)
|
||||||
} else if (k === 'totalAmount') {
|
} else if (k === 'totalAmount') {
|
||||||
item[k] = calculateTotal(row)
|
item[k] = calculateTotal(row)
|
||||||
} else if (this.isFullTankString) {
|
|
||||||
item[k] = setFullTank(row)
|
|
||||||
} else if (k === 'isTankFull') {
|
} else if (k === 'isTankFull') {
|
||||||
if (this.invertFullTank) {
|
if (this.isFullTankString) {
|
||||||
item[k] = Boolean(!row[headings[k]])
|
item[k] = setFullTank(row)
|
||||||
} else {
|
} else {
|
||||||
item[k] = Boolean(row[headings[k]])
|
if (this.invertFullTank) {
|
||||||
|
item[k] = Boolean(!row[headings[k]])
|
||||||
|
} else {
|
||||||
|
item[k] = Boolean(row[headings[k]])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (k === 'hasMissedFillup') {
|
} else if (k === 'hasMissedFillup') {
|
||||||
|
// TODO: need to account for this field being a string
|
||||||
|
item[k] = Boolean(row[headings[k]])
|
||||||
} else if (k === 'date') {
|
} else if (k === 'date') {
|
||||||
item[k] = new Date(row[headings[k]]).toISOString()
|
item[k] = new Date(row[headings[k]]).toISOString()
|
||||||
} else {
|
} else {
|
||||||
@@ -405,4 +409,3 @@ export default {
|
|||||||
</b-message>
|
</b-message>
|
||||||
</Layout>
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user