Browse Source

chore: format

pull/2455/head
Dhoni77 2 years ago
parent
commit
17034018e8
  1. 11
      apps/api/src/app/account/account.controller.ts
  2. 17
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  3. 2
      apps/client/src/app/services/data.service.ts

11
apps/api/src/app/account/account.controller.ts

@ -40,7 +40,7 @@ export class AccountController {
private readonly impersonationService: ImpersonationService, private readonly impersonationService: ImpersonationService,
private readonly portfolioService: PortfolioService, private readonly portfolioService: PortfolioService,
@Inject(REQUEST) private readonly request: RequestWithUser @Inject(REQUEST) private readonly request: RequestWithUser
) { } ) {}
@Delete(':id') @Delete(':id')
@UseGuards(AuthGuard('jwt')) @UseGuards(AuthGuard('jwt'))
@ -158,11 +158,9 @@ export class AccountController {
@Post('transfer-balance') @Post('transfer-balance')
@UseGuards(AuthGuard('jwt')) @UseGuards(AuthGuard('jwt'))
public async transferAccountBalance(@Body() { public async transferAccountBalance(
accountIdFrom, @Body() { accountIdFrom, accountIdTo, balance }: TransferBalanceDto
accountIdTo, ) {
balance
}: TransferBalanceDto) {
if ( if (
!hasPermission(this.request.user.permissions, permissions.updateAccount) !hasPermission(this.request.user.permissions, permissions.updateAccount)
) { ) {
@ -192,7 +190,6 @@ export class AccountController {
}); });
} }
@Put(':id') @Put(':id')
@UseGuards(AuthGuard('jwt')) @UseGuards(AuthGuard('jwt'))
public async update(@Param('id') id: string, @Body() data: UpdateAccountDto) { public async update(@Param('id') id: string, @Body() data: UpdateAccountDto) {

17
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -299,13 +299,16 @@ export class AccountsPageComponent implements OnDestroy, OnInit {
`Transfer cash balance of ${balance} from account ${accountIdFrom} to account ${accountIdTo}` `Transfer cash balance of ${balance} from account ${accountIdFrom} to account ${accountIdTo}`
); );
this.dataService.postTransferAccountBalance({ this.dataService
accountIdFrom, .postTransferAccountBalance({
accountIdTo, accountIdFrom,
balance accountIdTo,
}).pipe(takeUntil(this.unsubscribeSubject)).subscribe(() => { balance
this.router.navigate(['.'], { relativeTo: this.route }); })
}); .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.router.navigate(['.'], { relativeTo: this.route });
});
} }
}); });
} }

2
apps/client/src/app/services/data.service.ts

@ -47,7 +47,7 @@ import { map } from 'rxjs/operators';
providedIn: 'root' providedIn: 'root'
}) })
export class DataService { export class DataService {
public constructor(private http: HttpClient) { } public constructor(private http: HttpClient) {}
public buildFiltersAsQueryParams({ filters }: { filters?: Filter[] }) { public buildFiltersAsQueryParams({ filters }: { filters?: Filter[] }) {
let params = new HttpParams(); let params = new HttpParams();

Loading…
Cancel
Save