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

View File

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

View File

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