From 55b0fe232c4557f7f7198bd779f834e8546c15c9 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:04:28 +0200 Subject: [PATCH] Bugfix/reset form values to null if empty string (#3327) * Reset form values to null if empty string * Update changelog --- CHANGELOG.md | 4 ++++ .../asset-profile-dialog/asset-profile-dialog.component.ts | 4 ++-- .../create-or-update-account-dialog.component.ts | 4 ++-- .../create-or-update-activity-dialog.component.ts | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8568b2c0a..7bdafc2b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `prisma` from version `5.12.1` to `5.13.0` +### Fixed + +- Fixed the form submit in the asset profile details dialog of the admin control due to the `url` validation + ## 2.76.0 - 2024-04-23 ### Changed diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index d6403540a..783bbdbc4 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -291,12 +291,12 @@ export class AssetProfileDialog implements OnDestroy, OnInit { symbolMapping, assetClass: this.assetProfileForm.get('assetClass').value, assetSubClass: this.assetProfileForm.get('assetSubClass').value, - comment: this.assetProfileForm.get('comment').value ?? null, + comment: this.assetProfileForm.get('comment').value || null, currency: (( (this.assetProfileForm.get('currency').value) ))?.value, name: this.assetProfileForm.get('name').value, - url: this.assetProfileForm.get('url').value + url: this.assetProfileForm.get('url').value || null }; this.adminService diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts index 35dd2835f..6c3624344 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts @@ -106,12 +106,12 @@ export class CreateOrUpdateAccountDialog implements OnDestroy { public async onSubmit() { const account: CreateAccountDto | UpdateAccountDto = { balance: this.accountForm.get('balance').value, - comment: this.accountForm.get('comment').value, + comment: this.accountForm.get('comment').value || null, currency: this.accountForm.get('currency').value?.value, id: this.accountForm.get('accountId').value, isExcluded: this.accountForm.get('isExcluded').value, name: this.accountForm.get('name').value, - platformId: this.accountForm.get('platformId').value?.id ?? null + platformId: this.accountForm.get('platformId').value?.id || null }; try { diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts index f9ea4817c..700e997e1 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts @@ -448,7 +448,7 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { accountId: this.activityForm.get('accountId').value, assetClass: this.activityForm.get('assetClass').value, assetSubClass: this.activityForm.get('assetSubClass').value, - comment: this.activityForm.get('comment').value, + comment: this.activityForm.get('comment').value || null, currency: this.activityForm.get('currency').value, customCurrency: this.activityForm.get('currencyOfUnitPrice').value, date: this.activityForm.get('date').value,