[feat] - add user lsit , convert to coop and lock unlock user

This commit is contained in:
2024-08-19 17:05:10 +07:00
parent 57b9371d2a
commit 3cc3d72eb5
24 changed files with 617 additions and 91 deletions

View File

@@ -0,0 +1,31 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class SathonCathayPayService {
endpoint: string = environment.CATHAYAPIURL
constructor(
private http: HttpClient
) { }
getAllUsers(): Observable<[]> {
return this.http.get<[]>(`${this.endpoint}/v1/user`).pipe(map((d: any) => d.data))
}
lockUnlockUser(id: string): Observable<any> {
const request = { userId: id }
return this.http.post(`${this.endpoint}/v2/Authentication/LockUnlock`, request)
}
convertToCoperate(id: string): Observable<any> {
const request = { id }
return this.http.post(`${this.endpoint}/v1/User/convert2coperateType`, request)
}
}