Ledger now working with response_model
get_edit_url workaround found with transform clientside
This commit is contained in:
@ -47,7 +47,7 @@
|
||||
<!-- Particulars Column -->
|
||||
<ng-container matColumnDef="particulars">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Particulars</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [href]="row.url">{{row.name}}</a></mat-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/', row.url, row.id]">{{row.name}}</a></mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef>Closing Balance</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@ -56,8 +56,12 @@ export class LedgerComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: Ledger }) => {
|
||||
this.route.data.pipe(map(
|
||||
(data: { info: Ledger }) => {
|
||||
data.info.body = data.info.body.map(x => ({...x, url: x['type'].replace(/ /g, '-').toLowerCase()}));
|
||||
return data;
|
||||
}
|
||||
)).subscribe((data: { info: Ledger }) => {
|
||||
this.info = data.info;
|
||||
this.calculateTotals();
|
||||
this.form.setValue({
|
||||
|
||||
Reference in New Issue
Block a user