init to partner panel
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { IPaginatedResponse } from '@/core/models/service.model';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { PARTNER_ACCOUNTS_API_ROUTES } from '../constants';
|
||||
import { IAccountRawResponse, IAccountRequest, IAccountResponse } from '../models';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AccountsService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
private apiRoutes = PARTNER_ACCOUNTS_API_ROUTES;
|
||||
|
||||
getAll(): Observable<IPaginatedResponse<IAccountResponse>> {
|
||||
return this.http.get<IPaginatedResponse<IAccountRawResponse>>(this.apiRoutes.list());
|
||||
}
|
||||
getSingle(accountId: string): Observable<IAccountResponse> {
|
||||
return this.http.get<IAccountRawResponse>(this.apiRoutes.single(accountId));
|
||||
}
|
||||
|
||||
update(accountId: string, userData: IAccountRequest): Observable<IAccountResponse> {
|
||||
return this.http.patch<IAccountResponse>(this.apiRoutes.single(accountId), userData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user