integrasi update password

This commit is contained in:
2024-07-03 17:39:46 +07:00
parent 4b023b2527
commit ccf656dfce
6 changed files with 161 additions and 96 deletions

View 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 });
}
}