Cleanup code.
This commit is contained in:
parent
296c89ce20
commit
161eb42942
@ -1,6 +1,6 @@
|
|||||||
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
// vim: set tw=80 ts=2 sw=2 sts=2 :
|
||||||
import { CurrencyPipe } from '@angular/common';
|
import { CurrencyPipe } from '@angular/common';
|
||||||
import { Component, Inject, Input, Output, EventEmitter } from '@angular/core';
|
import { Component, Inject, Input } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { Logger } from '@nsalaun/ng-logger';
|
import { Logger } from '@nsalaun/ng-logger';
|
||||||
@ -77,7 +77,6 @@ import { OperationDeleteModalComponent } from './operationDeleteModal.component'
|
|||||||
export class OperationRowComponent {
|
export class OperationRowComponent {
|
||||||
@Input('operation-row') operation: Operation;
|
@Input('operation-row') operation: Operation;
|
||||||
@Input() account: Account;
|
@Input() account: Account;
|
||||||
@Output() needsReload: EventEmitter<void> = new EventEmitter<void>();
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private operationService: OperationService,
|
private operationService: OperationService,
|
||||||
@ -105,8 +104,6 @@ export class OperationRowComponent {
|
|||||||
return this.operationService.update(operation).subscribe((operation) => {
|
return this.operationService.update(operation).subscribe((operation) => {
|
||||||
this.toastrService.success('Operation #' + operation.id + ' saved.');
|
this.toastrService.success('Operation #' + operation.id + ' saved.');
|
||||||
|
|
||||||
this.needsReload.emit();
|
|
||||||
|
|
||||||
this.logger.info('Reload route', this.router.url);
|
this.logger.info('Reload route', this.router.url);
|
||||||
this.router.navigateByUrl(this.router.url);
|
this.router.navigateByUrl(this.router.url);
|
||||||
}, (result) => {
|
}, (result) => {
|
||||||
@ -135,8 +132,6 @@ export class OperationRowComponent {
|
|||||||
return this.operationService.delete(operation).subscribe(() => {
|
return this.operationService.delete(operation).subscribe(() => {
|
||||||
this.toastrService.success('Operation #' + id + ' deleted.');
|
this.toastrService.success('Operation #' + id + ' deleted.');
|
||||||
|
|
||||||
this.needsReload.emit();
|
|
||||||
|
|
||||||
this.logger.info('Reload route', this.router.url);
|
this.logger.info('Reload route', this.router.url);
|
||||||
this.router.navigateByUrl(this.router.url);
|
this.router.navigateByUrl(this.router.url);
|
||||||
}, (result) => {
|
}, (result) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user