update superAdmin users business

This commit is contained in:
2026-03-14 16:26:22 +03:30
parent 9bfbef6f64
commit 20be653499
126 changed files with 2891 additions and 169 deletions
@@ -0,0 +1,28 @@
import { IPaginatedResponse } from '@/core/models/service.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { DEVICES_API_ROUTES } from '../constants';
import { IDeviceRawResponse, IDeviceRequest, IDeviceResponse } from '../models';
@Injectable({ providedIn: 'root' })
export class SuperAdminDeviceService {
constructor(private http: HttpClient) {}
private apiRoutes = DEVICES_API_ROUTES;
getAll(): Observable<IPaginatedResponse<IDeviceResponse>> {
return this.http.get<IPaginatedResponse<IDeviceRawResponse>>(this.apiRoutes.list());
}
// getSingle(userId: string): Observable<IDeviceBrandResponse> {
// return this.http.get<IDeviceBrandRawResponse>(this.apiRoutes.single(userId));
// }
create(userData: IDeviceRequest): Observable<IDeviceResponse> {
return this.http.post<IDeviceResponse>(this.apiRoutes.list(), userData);
}
update(userId: string, userData: IDeviceRequest): Observable<IDeviceResponse> {
return this.http.patch<IDeviceResponse>(this.apiRoutes.single(userId), userData);
}
}