diff --git a/angular/RestClient/src/app/app.routes.ts b/angular/RestClient/src/app/app.routes.ts index 0f07bf5d33e5b14813864374cd668f79b77e95d7..8a24a518d73cd82d34ebd7658472adbd237e17f9 100644 --- a/angular/RestClient/src/app/app.routes.ts +++ b/angular/RestClient/src/app/app.routes.ts @@ -1,5 +1,5 @@ import { UnauthorizedComponent } from './page/unauthorized/unauthorized.component'; -import { AppRoute } from './core/models'; +import { AppRoute } from './core/models/Route.interface'; import { rolGuard, rolGuardChild } from '@core/guards'; export const routes: AppRoute[] = [ // Auth diff --git a/angular/RestClient/src/app/core/guards/rol.guard.ts b/angular/RestClient/src/app/core/guards/rol.guard.ts index b6d67d26e00fbc996fd96b90742a3bddf974a3c1..f63b9bc21aee027bf18b1ee5472f0464d1eb1079 100644 --- a/angular/RestClient/src/app/core/guards/rol.guard.ts +++ b/angular/RestClient/src/app/core/guards/rol.guard.ts @@ -5,7 +5,8 @@ import { CanActivateFn, Router, } from '@angular/router'; -import { Session, UserRol } from '@core/models'; +import { Session } from '@core/models/Session.interface'; +import { UserRol } from '../../features/users/types/User.interface'; import { SessionService } from '@core/services'; import { map } from 'rxjs'; diff --git a/angular/RestClient/src/app/core/services/api/hotels/hotel-client.service.ts b/angular/RestClient/src/app/core/services/api/hotels/hotel-client.service.ts index 5b5336c075d5e77346631fea7aea5ee766ef0d4c..e71cb6d0f1eed7a8be287608890962a9d1925977 100644 --- a/angular/RestClient/src/app/core/services/api/hotels/hotel-client.service.ts +++ b/angular/RestClient/src/app/core/services/api/hotels/hotel-client.service.ts @@ -1,9 +1,12 @@ import { Injectable } from '@angular/core'; import { environment } from '../../../../../environments/environment'; import { HttpClient } from '@angular/common/http'; -import { Hotel, Room } from '../../../models'; import { SessionService } from '../../session/session.service'; import { catchError, map, switchMap, throwError } from 'rxjs'; +import { Hotel, Room } from '@features/hotels'; + +let hotel:Hotel; +let rooms:Room; @Injectable({ providedIn: 'root', diff --git a/angular/RestClient/src/app/core/services/api/users/user-client.service.ts b/angular/RestClient/src/app/core/services/api/users/user-client.service.ts index ec9e5d7d4222c7152195c7ed9f4e7521dab1e865..37b34a8ba7beaedda0627ac05274b2dc43bb809a 100644 --- a/angular/RestClient/src/app/core/services/api/users/user-client.service.ts +++ b/angular/RestClient/src/app/core/services/api/users/user-client.service.ts @@ -1,9 +1,15 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { environment } from '../../../../../environments/environment'; -import { Client, Session, User, UserState } from '../../../models'; import { SessionService } from '../../session/session.service'; import { tap } from 'rxjs'; +import { Client, ClientState, User } from '@features/users'; +import { Session } from 'inspector'; + +let user:User; +let session:Session; +let client:Client; +let userstate:ClientState; @Injectable({ providedIn: 'root', @@ -29,7 +35,7 @@ export class UserClientService { } // Cambiar estado de un usuario - alterUserStatus(userId: number, status: UserState) { + alterUserStatus(userId: number, status: ClientState) { return this.http.patch( `${this.URI}/${userId}`, { diff --git a/angular/RestClient/src/app/features/hotels/hotels.routes.ts b/angular/RestClient/src/app/features/hotels/hotels.routes.ts index d054f0ab51aa1b583477e30a22ef1e1949fb1e6e..bf57124cd5b570b3ea3329202bfbf95c5aa43fea 100644 --- a/angular/RestClient/src/app/features/hotels/hotels.routes.ts +++ b/angular/RestClient/src/app/features/hotels/hotels.routes.ts @@ -1,4 +1,4 @@ -import { AppRoute } from '@core/models'; +import { AppRoute } from '@core/models/Route.interface'; import { HotelRegisterComponent } from './hotel-register/hotel-register.component'; import { HotelListComponent } from './hotel-list/hotel-list.component'; import { rolGuard } from '@core/guards'; diff --git a/angular/RestClient/src/app/features/users/types/User.interface.ts b/angular/RestClient/src/app/features/users/types/User.interface.ts index 955e3235074035657af30cee51f3e1860b05744d..f2eb3543d9206b33d1b23ca144e056847193a180 100644 --- a/angular/RestClient/src/app/features/users/types/User.interface.ts +++ b/angular/RestClient/src/app/features/users/types/User.interface.ts @@ -9,7 +9,7 @@ export interface User { } export const UserRolesArray = ['CLIENT', 'HOTEL_ADMIN', 'ADMIN'] as const; -export type UserRol = typeof UserRolesArray; +export type UserRol = 'CLIENT' | 'HOTEL_ADMIN' | 'ADMIN'; export interface Client extends User { status: ClientState;