From fc8be33dc6d33642ae207b6ae4c17a6ec254d11a Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 13 Dec 2024 12:02:51 +0200 Subject: [PATCH] RED-9580 - added getOne method for stats service to call new users stats endpoint and updated data from "delete user dialog" with new backend data --- src/lib/services/stats.service.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/services/stats.service.ts b/src/lib/services/stats.service.ts index 28545aa..2da20ca 100644 --- a/src/lib/services/stats.service.ts +++ b/src/lib/services/stats.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; import { BehaviorSubject, Observable, switchMap } from 'rxjs'; -import { tap } from 'rxjs/operators'; +import { map, tap } from 'rxjs/operators'; import { HeadersConfiguration } from '../utils/headers-configuration'; import { mapEach } from '../utils/operators'; @@ -26,6 +26,14 @@ export abstract class StatsService { ); } + getOne(id: string): Observable { + const request = this.#http.get(`/${this._serviceName}/${encodeURI(this._defaultModelPath)}/${id}`, { + headers: HeadersConfiguration.getHeaders(), + }); + + return request.pipe(map(entity => new this._entityClass(entity))); + } + get(key: string): E { return this._getBehaviourSubject(key).value; }