[feat] - add user lsit , convert to coop and lock unlock user
This commit is contained in:
31
src/app/sathon-cathay-pay.service.ts
Normal file
31
src/app/sathon-cathay-pay.service.ts
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user