diff --git a/angular/RestClient/src/app/core/features/user/main-page/main-page.component.html b/angular/RestClient/src/app/core/features/user/main-page/main-page.component.html index 06857529f8bf00a6937bb6b02d36bd32879458d5..03dd10b379c3ca05b647e211f41dea3279317592 100644 --- a/angular/RestClient/src/app/core/features/user/main-page/main-page.component.html +++ b/angular/RestClient/src/app/core/features/user/main-page/main-page.component.html @@ -4,7 +4,7 @@ <div class="filter-container"> <label for="filter">Filtrar por estado:</label> <select id="filter" [(ngModel)]="selectedStatus" (change)="filterUsers()"> - <option value="all">Todos</option> + <option value="All">Todos</option> <option value="NO_BOOKINGS">Sin reservas</option> <option value="WITH_ACTIVE_BOOKINGS">Con reservas activas</option> <option value="WITH_INACTIVE_BOOKING">Con reservas inactivas</option> diff --git a/angular/RestClient/src/app/core/features/user/main-page/main-page.component.ts b/angular/RestClient/src/app/core/features/user/main-page/main-page.component.ts index e1f720168b60365a0753522e0333b8c14e771fc7..b13b3529569730bee9efbad07e2894f8e645ad91 100644 --- a/angular/RestClient/src/app/core/features/user/main-page/main-page.component.ts +++ b/angular/RestClient/src/app/core/features/user/main-page/main-page.component.ts @@ -1,7 +1,7 @@ // main-page.component.ts import { Component, OnInit } from '@angular/core'; import { ClienteApiRestService } from '../../../../shared/cliente-api-rest.service'; -import { User } from '../../../../../types'; +import { User, UserStateFilter } from '../../../../../types'; import { FormsModule } from '@angular/forms'; import { CommonModule } from '@angular/common'; import users from '../../../../../mocks/users.json'; @@ -16,7 +16,7 @@ import { RouterModule } from '@angular/router'; export class MainPageComponent implements OnInit { users: User[] = []; filteredUsers: User[] = []; - selectedStatus: string = 'all'; + selectedStatus: UserStateFilter = 'All'; constructor(private ClienteApiRestService: ClienteApiRestService) {} @@ -29,7 +29,7 @@ export class MainPageComponent implements OnInit { } filterUsers(): void { - if (this.selectedStatus === 'all') { + if (this.selectedStatus === 'All') { this.filteredUsers = this.users; } else { this.filteredUsers = this.users.filter( diff --git a/angular/RestClient/src/types/User.d.ts b/angular/RestClient/src/types/User.d.ts index 09a0ec82f1aa9dab3f0a946cca718206297c8c13..1ecc3d7512e7ff0b644e5555d290c48e88518219 100644 --- a/angular/RestClient/src/types/User.d.ts +++ b/angular/RestClient/src/types/User.d.ts @@ -6,6 +6,8 @@ export interface User { status: UserState; } +export type UserStateFilter = 'All' | UserState; + export type UserState = | 'NO_BOOKINGS' | 'WITH_ACTIVE_BOOKINGS'