aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/services/users.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/services/users.service.ts')
-rw-r--r--ufund-ui/src/app/services/users.service.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/ufund-ui/src/app/services/users.service.ts b/ufund-ui/src/app/services/users.service.ts
index 1b6dfb6..571c004 100644
--- a/ufund-ui/src/app/services/users.service.ts
+++ b/ufund-ui/src/app/services/users.service.ts
@@ -8,6 +8,8 @@ import {User} from '../models/User';
})
export class UsersService {
+ private currentUserID? : number
+
private url = "http://localhost:8080/users"
private httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
@@ -32,4 +34,8 @@ export class UsersService {
deleteUser(id: number): Observable<boolean> {
return this.http.delete<boolean>(`${this.url}/${id}`, this.httpOptions)
}
+
+ getCurrentUser(): Observable<User> | undefined {
+ return this.currentUserID ? this.getUser(this.currentUserID) : undefined
+ }
}