integrasi update password
This commit is contained in:
22
src/app/content/hemat-app/service/login.service.ts
Normal file
22
src/app/content/hemat-app/service/login.service.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
const BASE_URL = 'https://kapi.absys.ninja/hemat';
|
||||
|
||||
@Injectable({
|
||||
providedIn: "root",
|
||||
})
|
||||
export class LoginService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
updatePassword(data: any): Observable<any> {
|
||||
const endpoint = `/users`;
|
||||
const url = `${BASE_URL}${endpoint}/reset-password`;
|
||||
const headers = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT'
|
||||
});
|
||||
return this.http.put<any>(url, data, { headers });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user