Fix accounts route.

This commit is contained in:
Alexis Lahouze 2018-06-14 11:09:19 +02:00
parent 01d77b22c3
commit b753b59080
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<td>
<a [routerLink]="['/account', account.id, 'operations']">{{ account.name }}</a>
<a [routerLink]="[account.id, 'operations']">{{ account.name }}</a>
</td>
<td>
@ -33,7 +33,7 @@
<!-- Open account scheduler. -->
<a class="btn btn-secondary"
[hidden]="!account.id"
[routerLink]="['/account', account.id, 'scheduler']">
[routerLink]="[account.id, 'scheduler']">
<span class="fa fa-clock-o"></span>
</a>
</div>

View File

@ -6,12 +6,12 @@ import { OperationListComponent } from './operationList.component';
import { OperationEditComponent } from './operationEdit.component';
export const OperationRoutes: Routes = [{
path: 'account/:accountId/operations',
path: 'accounts/:accountId/operations',
component: OperationListComponent,
}, {
path: 'account/:accountId/operations/new',
path: 'accounts/:accountId/operations/new',
component: OperationEditComponent,
}, {
path: 'account/:accountId/operations/:operationId/edit',
path: 'accounts/:accountId/operations/:operationId/edit',
component: OperationEditComponent,
}];

View File

@ -89,7 +89,7 @@ export class OperationListComponent implements OnInit {
let toDay = this.route.snapshot.queryParamMap.get('to');
if(! fromDay && ! toDay) {
this.router.navigate(['account', accountId, 'operations'], {
this.router.navigate([], {
queryParams: {
from: moment().startOf('month').format('YYYY-MM-DD'),
to: moment().endOf('month').format('YYYY-MM-DD')