Fixed transaction submission

This commit is contained in:
piratefinn 2017-10-20 13:21:49 +01:00
parent 1ce755d2d3
commit 0a9e80fc97
3 changed files with 13 additions and 13 deletions

View file

@ -32,7 +32,7 @@ export class AddDataComponent implements OnInit {
organisationPostcode: string;
amount: number;
transactionAdditionType = 1;
storeList;
storeList = [];
showAddStore = false;
submitReceipt = false;
transactionFormInvalid = true;
@ -108,7 +108,7 @@ export class AddDataComponent implements OnInit {
}
// handle the case when the storelist is empty
if (this.storeList.length < 1) {
this.storeList = null;
this.storeList = [];
this.showAddStore = true;
this.transactionAdditionType = 3;
}
@ -135,7 +135,7 @@ export class AddDataComponent implements OnInit {
const val = ev.target.value;
// Filter the store list so search seems quicker
if (val && val.trim() !== '' && this.storeList !== null) {
if (val && val.trim() !== '' && this.storeList.length > 0) {
this.storeList = this.storeList.filter(
(item) => {
return ( item.name.toLowerCase().indexOf( val.toLowerCase() ) > -1 );