integrasi user profil

This commit is contained in:
2024-07-04 14:23:44 +07:00
parent 5913980330
commit ae74cf2332
3 changed files with 95 additions and 18 deletions

View File

@@ -19,4 +19,25 @@ export class LoginService {
});
return this.http.put<any>(url, data, { headers });
}
getDataProfil(id): Observable<any> {
const endpoint = `/users`;
const url = `${BASE_URL}${endpoint}/byUserid/${id}`;
const headers = new HttpHeaders({
"Content-Type": "application/json",
"x-api-key": "j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT",
});
return this.http.get<any>(url, { headers });
}
updateProfile(data: any, userId: string): Observable<any> {
const endpoint = `/users`;
const url = `${BASE_URL}${endpoint}/update/${userId}`;
const headers = new HttpHeaders({
"x-api-key": "j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT",
});
return this.http.post(`${url}`, data, { headers });
}
}