Ledger now working with response_model
get_edit_url workaround found with transform clientside
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user