Browse Source
Task/improve typings of getInfo() functionality (#5803)
* Improve typings
pull/5618/head
vitalymatyushik
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
9 additions and
4 deletions
-
apps/api/src/app/info/info.controller.ts
-
apps/client/src/main.ts
-
libs/common/src/lib/interfaces/index.ts
-
libs/common/src/lib/interfaces/responses/info-response.interface.ts
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { TransformDataSourceInResponseInterceptor } from '@ghostfolio/api/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor'; |
|
|
|
import { InfoItem } from '@ghostfolio/common/interfaces'; |
|
|
|
import { InfoResponse } from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
|
|
import { Controller, Get, UseInterceptors } from '@nestjs/common'; |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ export class InfoController { |
|
|
|
|
|
|
|
@Get() |
|
|
|
@UseInterceptors(TransformDataSourceInResponseInterceptor) |
|
|
|
public async getInfo(): Promise<InfoItem> { |
|
|
|
public async getInfo(): Promise<InfoResponse> { |
|
|
|
return this.infoService.get(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { locale } from '@ghostfolio/common/config'; |
|
|
|
import { InfoItem } from '@ghostfolio/common/interfaces'; |
|
|
|
import { InfoResponse } from '@ghostfolio/common/interfaces'; |
|
|
|
import { filterGlobalPermissions } from '@ghostfolio/common/permissions'; |
|
|
|
|
|
|
|
import { enableProdMode } from '@angular/core'; |
|
|
|
@ -11,7 +11,7 @@ import { environment } from './environments/environment'; |
|
|
|
|
|
|
|
(async () => { |
|
|
|
const response = await fetch('/api/v1/info'); |
|
|
|
const info: InfoItem = await response.json(); |
|
|
|
const info: InfoResponse = await response.json(); |
|
|
|
const utmSource = window.localStorage.getItem('utm_source') as |
|
|
|
| 'ios' |
|
|
|
| 'trusted-web-activity'; |
|
|
|
|
|
|
|
@ -50,6 +50,7 @@ import type { DividendsResponse } from './responses/dividends-response.interface |
|
|
|
import type { ResponseError } from './responses/errors.interface'; |
|
|
|
import type { HistoricalResponse } from './responses/historical-response.interface'; |
|
|
|
import type { ImportResponse } from './responses/import-response.interface'; |
|
|
|
import type { InfoResponse } from './responses/info-response.interface'; |
|
|
|
import type { LookupResponse } from './responses/lookup-response.interface'; |
|
|
|
import type { MarketDataDetailsResponse } from './responses/market-data-details-response.interface'; |
|
|
|
import type { MarketDataOfMarketsResponse } from './responses/market-data-of-markets-response.interface'; |
|
|
|
@ -112,6 +113,7 @@ export { |
|
|
|
HoldingWithParents, |
|
|
|
ImportResponse, |
|
|
|
InfoItem, |
|
|
|
InfoResponse, |
|
|
|
InvestmentItem, |
|
|
|
LineChartItem, |
|
|
|
LookupItem, |
|
|
|
|
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
import { InfoItem } from '../index'; |
|
|
|
|
|
|
|
export interface InfoResponse extends InfoItem {} |