Skip to content

Commit

Permalink
Refactor login component imports and update not found page status code
Browse files Browse the repository at this point in the history
  • Loading branch information
vnobo committed Oct 12, 2024
1 parent 85f1480 commit 58d49ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions ng-web/src/app/pages/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Component, inject, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
import { Credentials, LoginService } from './login.service';
import { ActivatedRoute, Router } from '@angular/router';
import { debounceTime, distinctUntilChanged, Subject, takeUntil } from 'rxjs';
import { NzFormModule } from 'ng-zorro-antd/form';
import { CommonModule } from '@angular/common';
import { debounceTime, distinctUntilChanged, Subject, takeUntil } from 'rxjs';
import { Credentials, LoginService } from './login.service';

@Component({
selector: 'app-login',
Expand All @@ -14,7 +14,8 @@ import { CommonModule } from '@angular/common';
styleUrls: ['./login.component.scss'],
})
export class LoginComponent implements OnInit, OnDestroy {
formBuilder: FormBuilder = Inject(FormBuilder);
formBuilder: FormBuilder = inject(FormBuilder);

loginForm = this.formBuilder.group({
username: new FormControl('', [Validators.required, Validators.minLength(5), Validators.maxLength(64)]),
password: new FormControl('', [Validators.required, Validators.minLength(6), Validators.maxLength(64)]),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nz-result nzStatus="403" nzSubTitle="Sorry, you are not authorized to access this page." nzTitle="403">
<nz-result nzStatus="404" nzSubTitle="Sorry, you are not authorized to access this page." nzTitle="404">
<div class="" nz-result-extra>
<a href="/home" nz-button nzType="primary">Back Home</a>
</div>
Expand Down

0 comments on commit 58d49ba

Please sign in to comment.