style: format code and add prettier configuration files

This commit is contained in:
Jan K9f 2025-01-21 13:29:09 +01:00
commit 395c1bc75f
Signed by: jank
GPG key ID: 50620ADD22CD330B
39 changed files with 338 additions and 207 deletions

View file

@ -8,14 +8,14 @@ import { Router } from '@angular/router';
selector: 'app-login',
imports: [ReactiveFormsModule],
templateUrl: './login.component.html',
styleUrl: './login.component.css'
styleUrl: './login.component.css',
})
export class LoginComponent {
public loginForm!: FormGroup;
public invalidCredentials = false;
private pb = new PocketBase(environment.POCKETBASE);
constructor(private router: Router) { };
constructor(private router: Router) {}
ngOnInit(): void {
this.loginForm = new FormGroup({
@ -29,13 +29,17 @@ export class LoginComponent {
}
submit() {
this.pb.collection("users").authWithPassword(
this.loginForm.get('email')?.value,
this.loginForm.get('password')?.value
).then(() => {
this.pb
.collection('users')
.authWithPassword(
this.loginForm.get('email')?.value,
this.loginForm.get('password')?.value,
)
.then(() => {
this.router.navigate(['dashboard']);
}).catch(() => {
this.invalidCredentials = true;
});
})
.catch(() => {
this.invalidCredentials = true;
});
}
}