Browse Source

null value for smsEnabled is interpreted as enabled on backend

pull/14792/head
dashevchenko 9 months ago
parent
commit
ec128f3e85
  1. 5
      ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.ts

5
ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.ts

@ -20,7 +20,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '@app/core/core.state'; import { AppState } from '@app/core/core.state';
import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { DefaultTenantProfileConfiguration, TenantProfileConfiguration } from '@shared/models/tenant.model'; import { DefaultTenantProfileConfiguration, TenantProfileConfiguration } from '@shared/models/tenant.model';
import { isDefinedAndNotNull } from '@core/utils'; import { isDefinedAndNotNull, isUndefinedOrNull} from '@core/utils';
import { RateLimitsType } from './rate-limits/rate-limits.models'; import { RateLimitsType } from './rate-limits/rate-limits.models';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@ -179,6 +179,9 @@ export class DefaultTenantProfileConfigurationComponent implements ControlValueA
writeValue(value: DefaultTenantProfileConfiguration | null): void { writeValue(value: DefaultTenantProfileConfiguration | null): void {
if (isDefinedAndNotNull(value)) { if (isDefinedAndNotNull(value)) {
if (isUndefinedOrNull(value.smsEnabled)) {
value.smsEnabled = true;
}
this.maxSmsValidation(value.smsEnabled); this.maxSmsValidation(value.smsEnabled);
this.defaultTenantProfileConfigurationFormGroup.patchValue(value, {emitEvent: false}); this.defaultTenantProfileConfigurationFormGroup.patchValue(value, {emitEvent: false});
} }

Loading…
Cancel
Save