Skip to content

Commit

Permalink
* dev-angular-v18 : Se corrige servicio de books
Browse files Browse the repository at this point in the history
// !# Cambios
- Se corrige servicio de books
- Se agrega mensaje de error al iniciar sesión
  • Loading branch information
maximovj committed Dec 3, 2024
1 parent b5cea4e commit c44b13c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class LoginPageComponent implements OnInit {
private authService = inject(AuthService);

public myForm :FormGroup = this.fb.group({
email: ['eloisa00@example.net', [Validators.required]],
password: ['password', [Validators.required]],
email: ['', [Validators.required]],
password: ['', [Validators.required]],
});

constructor() { }
Expand All @@ -51,6 +51,9 @@ export class LoginPageComponent implements OnInit {
this.toastr.success('Haz iniciado sesión correctamente', 'Inicio de sesión');
this.router.navigateByUrl('/books/list');
},
error: () => {
this.toastr.error('Usuario o contraseña incorrecta.', 'Inicio de sesión');
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class BooksService {
return of(null);
}

return this.http.post<ReserveBookResponse>('${this.ENV_BASE_URL_API}/v1/reserve/book/register', reserveBookRequest, {
return this.http.post<ReserveBookResponse>(`${this.ENV_BASE_URL_API}/v1/reserve/book/register`, reserveBookRequest, {
headers: {
'Authorization' : `Bearer ${_token}`,
}
Expand Down

0 comments on commit c44b13c

Please sign in to comment.