Browse Source

Resolve validation error caused by empty strings

pull/7510/head
Thomas Kaul 1 month ago
parent
commit
d84dcfbab1
  1. 9
      apps/client/eslint.config.cjs
  2. 10
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

9
apps/client/eslint.config.cjs

@ -48,7 +48,14 @@ module.exports = [
files: ['**/*.ts', '**/*.tsx'],
// Override or add rules here
rules: {
'@typescript-eslint/prefer-nullish-coalescing': 'error'
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
{
ignorePrimitives: {
string: true
}
}
]
}
},
{

10
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts

@ -570,7 +570,7 @@ export class GfAssetProfileDialogComponent implements OnInit {
) as Record<string, string>,
locale:
this.assetProfileForm.controls.scraperConfiguration.controls.locale
?.value ?? undefined,
?.value || undefined,
mode:
this.assetProfileForm.controls.scraperConfiguration.controls.mode
?.value ?? undefined,
@ -619,7 +619,7 @@ export class GfAssetProfileDialogComponent implements OnInit {
assetClass: this.assetProfileForm.controls.assetClass.value ?? undefined,
assetSubClass:
this.assetProfileForm.controls.assetSubClass.value ?? undefined,
comment: this.assetProfileForm.controls.comment.value ?? undefined,
comment: this.assetProfileForm.controls.comment.value || undefined,
currency: this.assetProfileForm.controls.currency.value ?? undefined,
dataGatheringFrequency:
this.assetProfileForm.controls.dataGatheringFrequency.value ??
@ -627,8 +627,8 @@ export class GfAssetProfileDialogComponent implements OnInit {
isActive: isBoolean(this.assetProfileForm.controls.isActive.value)
? this.assetProfileForm.controls.isActive.value
: undefined,
name: this.assetProfileForm.controls.name.value ?? undefined,
url: this.assetProfileForm.controls.url.value ?? undefined
name: this.assetProfileForm.controls.name.value || undefined,
url: this.assetProfileForm.controls.url.value || undefined
};
try {
@ -739,7 +739,7 @@ export class GfAssetProfileDialogComponent implements OnInit {
) as Record<string, string>,
locale:
this.assetProfileForm.controls.scraperConfiguration.controls.locale
?.value ?? undefined,
?.value || undefined,
mode: this.assetProfileForm.controls.scraperConfiguration.controls
.mode?.value,
selector:

Loading…
Cancel
Save