diff options
| author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-02 13:55:46 -0400 | 
|---|---|---|
| committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-02 13:55:46 -0400 | 
| commit | 6ce39f0facc6ae38ff42d1e8efe091f528afc5a0 (patch) | |
| tree | dcfa082882f6c9c8a1e096889a823a45bd73a5ef /ufund-ui/src | |
| parent | f14d070155a6927d544a908545c648c402948fea (diff) | |
| download | JellySolutions-6ce39f0facc6ae38ff42d1e8efe091f528afc5a0.tar.gz JellySolutions-6ce39f0facc6ae38ff42d1e8efe091f528afc5a0.tar.bz2 JellySolutions-6ce39f0facc6ae38ff42d1e8efe091f528afc5a0.zip  | |
Signup logs you in and brings you to home page now. Also modified toasts in funding basket
Diffstat (limited to '')
| -rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.ts | 6 | ||||
| -rw-r--r-- | ufund-ui/src/app/components/signup/signup.component.ts | 7 | 
2 files changed, 8 insertions, 5 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 dcacca1..847baee 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 @@ -70,11 +70,11 @@ export class FundingBasketComponent implements OnInit {                  this.cupboardService.checkoutNeed(need.id, +contribution.value)                      .pipe(catchError((ex, _) => {                          if (ex.status == 500) { -                            this.toastService.sendToast(ToastType.INFO, 'Fields cannot be blank'); +                            this.toastService.sendToast(ToastType.ERROR, 'Fields cannot be blank');                          } else if (ex.status == 400) { -                            this.toastService.sendToast(ToastType.INFO, 'Goal must be greater than 0'); +                            this.toastService.sendToast(ToastType.ERROR, ex.error);                          } else { -                            this.toastService.sendToast(ToastType.INFO, 'Error on creating need'); +                            this.toastService.sendToast(ToastType.ERROR, 'Error on creating need');                          }                          return new Observable<string>();                      })) diff --git a/ufund-ui/src/app/components/signup/signup.component.ts b/ufund-ui/src/app/components/signup/signup.component.ts index b040d1a..9c37211 100644 --- a/ufund-ui/src/app/components/signup/signup.component.ts +++ b/ufund-ui/src/app/components/signup/signup.component.ts @@ -3,6 +3,7 @@ import {UsersService} from '../../services/users.service';  import {Router} from '@angular/router';  import {BehaviorSubject} from 'rxjs';  import {ToastsService, ToastType} from '../../services/toasts.service'; +import {AuthService} from '../../services/auth.service';  class PasswordRequirements {      sixLong:    {title: string, value: boolean} = {title: 'Is 6 characters or longer' , value: false} @@ -32,7 +33,8 @@ export class SignupComponent {      constructor(          protected usersService: UsersService,          protected router: Router, -        protected toastService: ToastsService +        protected toastService: ToastsService, +        protected authService: AuthService      ) {}      signup(username: string | null, password: string | null) { @@ -44,7 +46,8 @@ export class SignupComponent {          this.usersService.createUser(username, password).then(() => {              // let action = {label: 'Proceed to login', onAction: () => this.router.navigate(["/login"])}              this.toastService.sendToast(ToastType.INFO, "Account successfully created") -            this.router.navigate(["/login"]) +            this.authService.login(username, password) +            this.router.navigate(["/"])          }).catch(ex => {              this.toastService.sendToast(ToastType.ERROR, "Unable to create account: " + friendlyHttpStatus[ex.status])              console.log(ex)  | 
