aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/user-info.service.ts
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-24 06:31:08 +0100
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-24 06:31:08 +0100
commit042482a1bbd6ea3460acf3d71bfe3ef64b05524a (patch)
treee79413f97a8c9f97c978b5048ab89278ab0e6a41 /frontend/src/app/_services/user-info.service.ts
parent0aa45260963dbf0a52726f791c3813928a1bcebc (diff)
parent1113f094ffee030fd9892deb7577927419860013 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
# Conflicts: # frontend/src/app/app.module.ts
Diffstat (limited to 'frontend/src/app/_services/user-info.service.ts')
-rw-r--r--frontend/src/app/_services/user-info.service.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/frontend/src/app/_services/user-info.service.ts b/frontend/src/app/_services/user-info.service.ts
index b66a73e1..7ed2970c 100644
--- a/frontend/src/app/_services/user-info.service.ts
+++ b/frontend/src/app/_services/user-info.service.ts
@@ -12,15 +12,19 @@ export class UserInfoService {
constructor(private http: HttpClient, private authService: AuthService) { }
- getUsersInfo(): Observable<User> {
+ getUserInfo(): Observable<User> {
return this.http.get<User>(`${API_SETTINGS.apiURL}/user/myprofile`, { headers: this.authService.authHeader() });
}
changeUserInfo(user: User): any {
- return this.http.put(`${API_SETTINGS.apiURL}/user/${user._id}`, user, { headers: this.authService.authHeader() });
+ return this.http.put(`${API_SETTINGS.apiURL}/user/changeinfo`, user, { headers: this.authService.authHeader() });
}
- changeUserPassword(oldPassword: string, newPassword: string): Observable<User> {
- return this.http.put<User>(`${API_SETTINGS.apiURL}/user/`, { oldPassword, newPassword }, { headers: this.authService.authHeader() });
+ changeUserPassword(passwordArray: string[]): any {
+ return this.http.put(`${API_SETTINGS.apiURL}/user/changepass`, passwordArray, { headers: this.authService.authHeader(), responseType: 'text' });
+ }
+
+ deleteUser(): any {
+ return this.http.delete(`${API_SETTINGS.apiURL}/user/deleteprofile`, { headers: this.authService.authHeader() });
}
}