fixed category viewing and editing on several pages

This commit is contained in:
piratefinn 2018-03-19 17:52:54 +00:00
parent cd2a47bfdd
commit e7c718250f
10 changed files with 37 additions and 40 deletions

View file

@ -23,6 +23,7 @@ export class TransactionLogComponent implements OnInit {
public updatedDate: string;
public startTime: string;
categoryIdList: number[] = [];
categoryList: any;
categoryNameList: string[] = [];
public paginateConfig: PaginationInstance = {
@ -39,8 +40,8 @@ export class TransactionLogComponent implements OnInit {
this.myDate = moment().format('YYYY-MM-DD[T]HH:mm');
this.api.categoryList().subscribe(
result => {
//this.setCategoryList(result.categories);
this.categoryIdList = result.categories;
this.categoryList = result.categories;
this.categoryIdList = Object.keys(this.categoryList);
},
error => {
console.log('Retrieval Error');
@ -54,11 +55,6 @@ export class TransactionLogComponent implements OnInit {
this.loadTransactions(1);
}
private setCategoryList(data: any) {
this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
}
byId(c1: ItemModel, c2: ItemModel) {
return c1 && c2 ? c1.id === c2.id : c1 === c2;
}