Browse Source

Fix retirementDate persistence

pull/1748/head
Thomas 3 years ago
parent
commit
b99e7b4fad
  1. 7
      apps/api/src/app/user/update-user-setting.dto.ts
  2. 2
      apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
  3. 2
      libs/common/src/lib/interfaces/user-settings.interface.ts

7
apps/api/src/app/user/update-user-setting.dto.ts

@ -3,10 +3,11 @@ import type {
DateRange,
ViewMode
} from '@ghostfolio/common/types';
import { Type } from 'class-transformer';
import {
IsBoolean,
IsDate,
IsIn,
IsISO8601,
IsNumber,
IsOptional,
IsString
@ -53,9 +54,9 @@ export class UpdateUserSettingDto {
@IsOptional()
projectedTotalAmount?: number;
@IsDate()
@IsISO8601()
@IsOptional()
retirementDate?: Date;
retirementDate?: string;
@IsNumber()
@IsOptional()

2
apps/client/src/app/pages/portfolio/fire/fire-page.component.ts

@ -112,7 +112,7 @@ export class FirePageComponent implements OnDestroy, OnInit {
public onRetirementDateChange(retirementDate: Date) {
this.dataService
.putUserSetting({
retirementDate,
retirementDate: retirementDate.toISOString(),
projectedTotalAmount: null
})
.pipe(takeUntil(this.unsubscribeSubject))

2
libs/common/src/lib/interfaces/user-settings.interface.ts

@ -11,7 +11,7 @@ export interface UserSettings {
language?: string;
locale?: string;
projectedTotalAmount?: number;
retirementDate?: Date;
retirementDate?: string;
savingsRate?: number;
viewMode?: ViewMode;
}

Loading…
Cancel
Save