import { IPaginatedResponse } from '@/core/models/service.model'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { ACCOUNTS_API_ROUTES } from '../constants'; import { IAccountRawResponse, IAccountRequest, IAccountResponse } from '../models'; @Injectable({ providedIn: 'root' }) export class AdminUserAccountsService { constructor(private http: HttpClient) {} private apiRoutes = ACCOUNTS_API_ROUTES; getAll(userId: string): Observable> { return this.http.get>(this.apiRoutes.list(userId)); } getSingle(userId: string, accountId: string): Observable { return this.http.get(this.apiRoutes.single(userId, accountId)); } create(userId: string, data: IAccountRequest): Observable { return this.http.post(this.apiRoutes.list(userId), data); } update(userId: string, accountId: string, data: IAccountRequest): Observable { return this.http.patch(this.apiRoutes.single(userId, accountId), data); } }