Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/reorder methods of data service (#5597)

Thomas Kaulba205f7abb74
diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts
index 820ad5e3cf..6ab370399f 100644
--- a/apps/client/src/app/services/data.service.ts
+++ b/apps/client/src/app/services/data.service.ts
@@ -512,48 +512,6 @@ export class DataService {
);
}
- public fetchSymbolItem({
- dataSource,
- includeHistoricalData,
- symbol
- }: {
- dataSource: DataSource | string;
- includeHistoricalData?: number;
- symbol: string;
- }) {
- let params = new HttpParams();
-
- if (includeHistoricalData) {
- params = params.append('includeHistoricalData', includeHistoricalData);
- }
-
- return this.http.get<SymbolItem>(`/api/v1/symbol/${dataSource}/${symbol}`, {
- params
- });
- }
-
- public fetchSymbols({
- includeIndices = false,
- query
- }: {
- includeIndices?: boolean;
- query: string;
- }) {
- let params = new HttpParams().set('query', query);
-
- if (includeIndices) {
- params = params.append('includeIndices', includeIndices);
- }
-
- return this.http
- .get<LookupResponse>('/api/v1/symbol/lookup', { params })
- .pipe(
- map(({ items }) => {
- return items;
- })
- );
- }
-
public fetchPortfolioDetails({
filters,
withMarkets = false
@@ -725,6 +683,48 @@ export class DataService {
);
}
+ public fetchSymbolItem({
+ dataSource,
+ includeHistoricalData,
+ symbol
+ }: {
+ dataSource: DataSource | string;
+ includeHistoricalData?: number;
+ symbol: string;
+ }) {
+ let params = new HttpParams();
+
+ if (includeHistoricalData) {
+ params = params.append('includeHistoricalData', includeHistoricalData);
+ }
+
+ return this.http.get<SymbolItem>(`/api/v1/symbol/${dataSource}/${symbol}`, {
+ params
+ });
+ }
+
+ public fetchSymbols({
+ includeIndices = false,
+ query
+ }: {
+ includeIndices?: boolean;
+ query: string;
+ }) {
+ let params = new HttpParams().set('query', query);
+
+ if (includeIndices) {
+ params = params.append('includeIndices', includeIndices);
+ }
+
+ return this.http
+ .get<LookupResponse>('/api/v1/symbol/lookup', { params })
+ .pipe(
+ map(({ items }) => {
+ return items;
+ })
+ );
+ }
+
public fetchTags() {
return this.http.get<Tag[]>('/api/v1/tags');
}