Update 0.0.3:
All checks were successful
Docker Image CI / build-and-push (push) Successful in 2m1s
Docker Image CI / deploy (push) Successful in 28s
Docker Image CI / notify-failure (push) Has been skipped

-delen van agenda toegevoegd
-popup aangepast
-accepteren van uitnodiging toegevoegd
This commit is contained in:
2025-04-18 22:38:21 +02:00
parent aaa712c37c
commit 781723fddf
26 changed files with 681 additions and 40 deletions

View File

@@ -4,10 +4,11 @@ import {Router} from '@angular/router';
import {TuiAppearance, TuiButton, TuiError, TuiTextfield,} from '@taiga-ui/core';
import {TuiCardLarge, TuiForm, TuiHeader} from '@taiga-ui/layout';
import {AuthService} from '../../services/auth.service';
import {UserDto} from '../../models/user-dto';
import {AppUserDto} from '../../models/app-user-dto';
import {HttpErrorResponse} from '@angular/common/http';
import {TuiValidationError} from '@taiga-ui/cdk';
import {environment} from '../../../environments/environment';
import {UserService} from '../../services/user.service';
@Component({
selector: 'app-login',
@@ -35,7 +36,7 @@ export class LoginComponent {
return this.enabled ? this.error : null;
}
constructor(private router: Router, private authService: AuthService) {
constructor(private router: Router, private authService: AuthService, private userService: UserService) {
this.form = new FormGroup({
username: new FormControl('', Validators.required),
password: new FormControl('', Validators.required)
@@ -44,9 +45,10 @@ export class LoginComponent {
login() {
console.log('IM LOGGING IN')
this.authService.login(this.form.get('username').value, this.form.get('password').value).subscribe({
next: (user: UserDto) => {
localStorage.setItem('token', user.token);
next: (user: AppUserDto) => {
this.userService.setUser(user);
this.router.navigate(['/home/agenda']);
},
error: (err: HttpErrorResponse) => {