From 7c87dfb5198394dde2e8669bd7a859617e81d94b Mon Sep 17 00:00:00 2001 From: csimonis Date: Thu, 15 May 2025 14:23:03 +0200 Subject: [PATCH] refactor(register): remove unused router import and variable --- .../src/app/feature/auth/register/register.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/feature/auth/register/register.component.ts b/frontend/src/app/feature/auth/register/register.component.ts index a421184..039378a 100644 --- a/frontend/src/app/feature/auth/register/register.component.ts +++ b/frontend/src/app/feature/auth/register/register.component.ts @@ -1,6 +1,5 @@ import { Component, EventEmitter, Output, signal } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; import { RegisterRequest } from '../../../model/auth/RegisterRequest'; import { AuthService } from '@service/auth.service'; import { CommonModule } from '@angular/common'; @@ -23,14 +22,13 @@ export class RegisterComponent { constructor( private fb: FormBuilder, private authService: AuthService, - private router: Router ) { this.registerForm = this.fb.group({ email: ['', [Validators.required, Validators.email]], username: ['', [Validators.required, Validators.minLength(3)]], password: ['', [Validators.required, Validators.minLength(6)]], }); - } + } get form() { return this.registerForm.controls; @@ -56,6 +54,11 @@ export class RegisterComponent { }; this.authService.register(registerRequest).subscribe({ + next: () => { + this.isLoading.set(false); + this.closeDialog.emit(); + this.switchToLogin(); + }, error: (err: HttpErrorResponse) => { this.isLoading.set(false);