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, DateRange,
ViewMode ViewMode
} from '@ghostfolio/common/types'; } from '@ghostfolio/common/types';
import { Type } from 'class-transformer';
import { import {
IsBoolean, IsBoolean,
IsDate,
IsIn, IsIn,
IsISO8601,
IsNumber, IsNumber,
IsOptional, IsOptional,
IsString IsString
@ -53,9 +54,9 @@ export class UpdateUserSettingDto {
@IsOptional() @IsOptional()
projectedTotalAmount?: number; projectedTotalAmount?: number;
@IsDate() @IsISO8601()
@IsOptional() @IsOptional()
retirementDate?: Date; retirementDate?: string;
@IsNumber() @IsNumber()
@IsOptional() @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) { public onRetirementDateChange(retirementDate: Date) {
this.dataService this.dataService
.putUserSetting({ .putUserSetting({
retirementDate, retirementDate: retirementDate.toISOString(),
projectedTotalAmount: null projectedTotalAmount: null
}) })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))

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

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

Loading…
Cancel
Save