refactor(register): remove unused router import and variable
Some checks failed
CI / Get Changed Files (pull_request) Successful in 8s
CI / Checkstyle Main (pull_request) Has been skipped
CI / Docker backend validation (pull_request) Has been skipped
CI / oxlint (pull_request) Successful in 22s
CI / prettier (pull_request) Failing after 26s
CI / eslint (pull_request) Successful in 30s
CI / Docker frontend validation (pull_request) Successful in 43s
CI / test-build (pull_request) Successful in 46s
Some checks failed
CI / Get Changed Files (pull_request) Successful in 8s
CI / Checkstyle Main (pull_request) Has been skipped
CI / Docker backend validation (pull_request) Has been skipped
CI / oxlint (pull_request) Successful in 22s
CI / prettier (pull_request) Failing after 26s
CI / eslint (pull_request) Successful in 30s
CI / Docker frontend validation (pull_request) Successful in 43s
CI / test-build (pull_request) Successful in 46s
This commit is contained in:
parent
84feb5f080
commit
7c87dfb519
1 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
||||||
import { Component, EventEmitter, Output, signal } from '@angular/core';
|
import { Component, EventEmitter, Output, signal } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { RegisterRequest } from '../../../model/auth/RegisterRequest';
|
import { RegisterRequest } from '../../../model/auth/RegisterRequest';
|
||||||
import { AuthService } from '@service/auth.service';
|
import { AuthService } from '@service/auth.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
@ -23,14 +22,13 @@ export class RegisterComponent {
|
||||||
constructor(
|
constructor(
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router
|
|
||||||
) {
|
) {
|
||||||
this.registerForm = this.fb.group({
|
this.registerForm = this.fb.group({
|
||||||
email: ['', [Validators.required, Validators.email]],
|
email: ['', [Validators.required, Validators.email]],
|
||||||
username: ['', [Validators.required, Validators.minLength(3)]],
|
username: ['', [Validators.required, Validators.minLength(3)]],
|
||||||
password: ['', [Validators.required, Validators.minLength(6)]],
|
password: ['', [Validators.required, Validators.minLength(6)]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get form() {
|
get form() {
|
||||||
return this.registerForm.controls;
|
return this.registerForm.controls;
|
||||||
|
@ -56,6 +54,11 @@ export class RegisterComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.authService.register(registerRequest).subscribe({
|
this.authService.register(registerRequest).subscribe({
|
||||||
|
next: () => {
|
||||||
|
this.isLoading.set(false);
|
||||||
|
this.closeDialog.emit();
|
||||||
|
this.switchToLogin();
|
||||||
|
},
|
||||||
error: (err: HttpErrorResponse) => {
|
error: (err: HttpErrorResponse) => {
|
||||||
this.isLoading.set(false);
|
this.isLoading.set(false);
|
||||||
|
|
||||||
|
|
Reference in a new issue