diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-18 00:24:42 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-18 00:24:42 -0400 |
commit | 3564917a539bc5bba7e149b8c157e0bd633be23e (patch) | |
tree | 896c1ffcb84310f853997e239ef31cf2cac7adb3 | |
parent | 02858a9af74b5f564b882adf38391dd3a1f5126c (diff) | |
download | JellySolutions-3564917a539bc5bba7e149b8c157e0bd633be23e.tar.gz JellySolutions-3564917a539bc5bba7e149b8c157e0bd633be23e.tar.bz2 JellySolutions-3564917a539bc5bba7e149b8c157e0bd633be23e.zip |
Fix problem in userService
-rw-r--r-- | ufund-ui/src/app/components/need-list/need-list.component.ts | 4 | ||||
-rw-r--r-- | ufund-ui/src/app/services/users.service.ts | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index 953904c..34e849d 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -105,14 +105,14 @@ export class NeedListComponent { add(need: Need) { const currentUser = this.usersService.getCurrentUser(); if (currentUser) { - this.usersService.updateUser(currentUser.username).subscribe(() => { + this.usersService.updateUser(currentUser.username, currentUser).subscribe(() => { const currentUser = this.usersService.getCurrentUser(); if (currentUser && currentUser.basket) { currentUser.basket.push(need); } }); } - + } back() { diff --git a/ufund-ui/src/app/services/users.service.ts b/ufund-ui/src/app/services/users.service.ts index f3166cc..bd6fe5e 100644 --- a/ufund-ui/src/app/services/users.service.ts +++ b/ufund-ui/src/app/services/users.service.ts @@ -40,8 +40,9 @@ export class UsersService { return this.http.get<User>(`${this.url}/${id}`, this.httpOptions) } - updateUser(id: string): Observable<User> { - return this.http.put<User>(`${this.url}/${id}`, this.httpOptions) + updateUser(id: string, user: User): Observable<User> { + console.log(this.apiKey) + return this.http.put<User>(`${this.url}/${id}`,user, this.httpOptions) } deleteUser(id: number): Observable<boolean> { |