Browse Source

fix update activity, hide update cash balance on edit

pull/1959/head
x1c0 2 years ago
parent
commit
9fac1373fd
  1. 4
      CHANGELOG.md
  2. 2
      apps/api/src/app/order/order.service.ts
  3. 16
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html

4
CHANGELOG.md

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed
- Fixed the error that was occuring when updating an activity and also hide the update cash balance in edit mode
## Unreleased ## Unreleased
### Changed ### Changed

2
apps/api/src/app/order/order.service.ts

@ -354,6 +354,7 @@ export class OrderService {
dataSource?: DataSource; dataSource?: DataSource;
symbol?: string; symbol?: string;
tags?: Tag[]; tags?: Tag[];
updateAccountBalance?: boolean;
}; };
where: Prisma.OrderWhereUniqueInput; where: Prisma.OrderWhereUniqueInput;
}): Promise<Order> { }): Promise<Order> {
@ -394,6 +395,7 @@ export class OrderService {
delete data.dataSource; delete data.dataSource;
delete data.symbol; delete data.symbol;
delete data.tags; delete data.tags;
delete data.updateAccountBalance;
// Remove existing tags // Remove existing tags
await this.prismaService.order.update({ await this.prismaService.order.update({

16
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.html

@ -18,8 +18,12 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div> <div [ngClass]="{'mb-3': data.activity.id}">
<mat-form-field appearance="outline" class="mb-1 without-hint w-100"> <mat-form-field
appearance="outline"
class="w-100"
[ngClass]="{'without-hint': !data.activity.id}"
>
<mat-label i18n>Account</mat-label> <mat-label i18n>Account</mat-label>
<mat-select formControlName="accountId"> <mat-select formControlName="accountId">
<mat-option <mat-option
@ -32,10 +36,10 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="mb-3"> <div class="mb-3" [ngClass]="{'d-none': data.activity.id}">
<mat-checkbox color="primary" formControlName="updateAccountBalance" i18n <mat-checkbox color="primary" formControlName="updateAccountBalance" i18n>
>Update Cash Balance</mat-checkbox Update Cash Balance
> </mat-checkbox>
</div> </div>
<div <div
class="mb-3" class="mb-3"

Loading…
Cancel
Save