fixed add data submission and removed unnecessary console logs

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

View file

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

View file

@ -124,30 +124,12 @@ export class TransactionLogComponent implements OnInit {
result => { result => {
if ( result.success === true ) { if ( result.success === true ) {
console.log('Successful Upload'); console.log('Successful Upload');
console.log(result);
this.transactionFormStatus = 'success';
console.log(this.transactionFormStatus);
this.resetForm();
} else { } else {
console.log('Upload Error'); console.log('Upload Error');
this.transactionFormStatusError = JSON.stringify(result.status) + 'Error, ' + JSON.stringify(result.message);
this.transactionFormStatus = 'send_failed';
console.log(this.transactionFormStatus);
} }
}, },
error => { error => {
console.log('Upload 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);
} }
); );
} }