fixed add data submission and removed unnecessary console logs
This commit is contained in:
parent
bad59b5e33
commit
cd2a47bfdd
2 changed files with 3 additions and 23 deletions
|
@ -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,
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue