Ledger now working with response_model

get_edit_url workaround found with transform clientside
This commit is contained in:
tanshu
2020-05-12 23:21:12 +05:30
parent 9c9f0dfdd6
commit 708a60baf7
18 changed files with 206 additions and 24 deletions

View File

@ -5,6 +5,7 @@ import {UnpostedDataSource} from './unposted-datasource';
import {Unposted} from './unposted';
import {ActivatedRoute, Router} from '@angular/router';
import {UnpostedService} from './unposted.service';
import {map} from 'rxjs/operators';
@Component({
selector: 'app-unposted',
@ -23,8 +24,12 @@ export class UnpostedComponent implements OnInit {
}
ngOnInit() {
this.route.data
.subscribe((data: { info: Unposted[] }) => {
this.route.data.pipe(map(
(data: { info: Unposted[] }) => {
data.info = data.info.map(x => ({...x, url: x['type'].replace(/ /g, '-').toLowerCase()}));
return data;
}
)).subscribe((data: { info: Unposted[] }) => {
this.info = data.info;
});
this.dataSource = new UnpostedDataSource(this.paginator, this.sort, this.info);