fixed add data submission and removed unnecessary console logs

This commit is contained in:
piratefinn 2018-03-19 16:28:46 +00:00
parent bad59b5e33
commit cd2a47bfdd
2 changed files with 3 additions and 23 deletions

View file

@ -40,11 +40,9 @@ export class AddDataComponent implements OnInit {
transactionFormInvalid = true;
myDate: any;
minDate: any;
leftCategoryIdList: number[] = [];
rightCategoryIdList: number[] = [];
leftCategoryNameList: string[] = [];
rightCategoryNameList: string[] = [];
categoryList: any;
leftCategoryList: number[] = [];
rightCategoryList: string[] = [];
categoryId: number;
constructor(
private formBuilder: FormBuilder,

View file

@ -124,30 +124,12 @@ export class TransactionLogComponent implements OnInit {
result => {
if ( result.success === true ) {
console.log('Successful Upload');
console.log(result);
this.transactionFormStatus = 'success';
console.log(this.transactionFormStatus);
this.resetForm();
} else {
console.log('Upload Error');
this.transactionFormStatusError = JSON.stringify(result.status) + 'Error, ' + JSON.stringify(result.message);
this.transactionFormStatus = 'send_failed';
console.log(this.transactionFormStatus);
}
},
error => {
console.log('Upload Error');
console.log(error);
try {
console.log(error.error);
const jsonError = error.json();
console.log('boop');
this.transactionFormStatusError = '"' + jsonError.error + '" Error, ' + jsonError.message;
} catch (e) {
this.transactionFormStatusError = 'There was a server error, please try again later.';
}
this.transactionFormStatus = 'send_failed';
console.log(this.transactionFormStatus);
}
);
}