diff options
4 files changed, 5 insertions, 4 deletions
| diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index 42015fe..9d25212 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -49,7 +49,7 @@ export class FundingBasketComponent implements      }      isInBasket(need: Need): boolean { -        return this.basket.some(n => n.id == need.id); +        return this.basket.includes(need)      }      addNeed(need: Need, quantity: number = 1): void { 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 0e808dc..5bb3887 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 @@ -101,7 +101,7 @@ export class NeedListComponent {      return type === ("HELPER" as unknown as userType);    } -  add(need: Need) { +  add(need: number) {      const currentUser = this.usersService.getCurrentUser();      if (currentUser) {        this.usersService.updateUser(currentUser.username, currentUser).subscribe(() => { @@ -114,7 +114,7 @@ export class NeedListComponent {            console.error(err);          }        }); -       +      }    } diff --git a/ufund-ui/src/app/models/User.ts b/ufund-ui/src/app/models/User.ts index b640e04..f4396f6 100644 --- a/ufund-ui/src/app/models/User.ts +++ b/ufund-ui/src/app/models/User.ts @@ -7,6 +7,6 @@ export enum userType {  export interface User {      username: string; -    basket: Need[]; +    basket: number[];      type: userType  } diff --git a/ufund-ui/src/app/services/users.service.ts b/ufund-ui/src/app/services/users.service.ts index bd6fe5e..bc31870 100644 --- a/ufund-ui/src/app/services/users.service.ts +++ b/ufund-ui/src/app/services/users.service.ts @@ -41,6 +41,7 @@ export class UsersService {      }      updateUser(id: string, user: User): Observable<User> { +        console.log(id, user)          console.log(this.apiKey)          return this.http.put<User>(`${this.url}/${id}`,user, this.httpOptions)      } | 
