aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/services/users.service.ts
diff options
context:
space:
mode:
authorHayden Hartman <haydenhartman10@gmail.com>2025-04-04 16:23:52 -0400
committerGitHub <noreply@github.com>2025-04-04 16:23:52 -0400
commit5a5d31896d79a736bce33b7d1aa7b3168ba308a9 (patch)
treea1e1862c0bb545bf8f9a642035fe5a791139ce27 /ufund-ui/src/app/services/users.service.ts
parent8cdf84ae4a6765db8f462cc71e2685c1d3514f08 (diff)
parent0a876b31609144c62f312ea59f074f5f79b67ae7 (diff)
downloadJellySolutions-5a5d31896d79a736bce33b7d1aa7b3168ba308a9.tar.gz
JellySolutions-5a5d31896d79a736bce33b7d1aa7b3168ba308a9.tar.bz2
JellySolutions-5a5d31896d79a736bce33b7d1aa7b3168ba308a9.zip
Merge pull request #28 from RIT-SWEN-261-02/css
css-merge
Diffstat (limited to 'ufund-ui/src/app/services/users.service.ts')
-rw-r--r--ufund-ui/src/app/services/users.service.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/ufund-ui/src/app/services/users.service.ts b/ufund-ui/src/app/services/users.service.ts
index 4080ebf..080c394 100644
--- a/ufund-ui/src/app/services/users.service.ts
+++ b/ufund-ui/src/app/services/users.service.ts
@@ -21,6 +21,15 @@ export class UsersService {
})
});
+ httpOptions2 = () => ({
+ headers: new HttpHeaders({
+ 'Content-Type': 'application/json',
+ "jelly-api-key": this.authService.getApiKey()
+ }),
+ responseType: "text" as "json" // don't ask me how or why this works, bc i have no clue...
+ // see the relevant angular bug report https://github.com/angular/angular/issues/18586
+ });
+
constructor(
private http: HttpClient,
private cupboardService: CupboardService,
@@ -35,6 +44,10 @@ export class UsersService {
return this.http.get<User>(`${this.url}/${id}`, this.httpOptions())
}
+ getCount(): Observable<number> {
+ return this.http.get<number>(`${this.url}/count`, this.httpOptions2())
+ }
+
updateUser(user: User): Observable<User> {
console.log(`${this.url}/${user.username}`, user, this.httpOptions)
return this.http.put<User>(`${this.url}/${user.username}`, user, this.httpOptions())