diff --git a/backend/src/route/route.module.ts b/backend/src/route/route.module.ts index 14a9b77b7e343aad8af3a16908a4a2bbab587d3b..8416b3a875058e1012545b73fd3d0a1d766f3eb9 100644 --- a/backend/src/route/route.module.ts +++ b/backend/src/route/route.module.ts @@ -1,4 +1,4 @@ -import { Module } from '@nestjs/common'; +import { forwardRef, Module } from '@nestjs/common'; import { RouteService } from './route.service'; import { RouteController } from './route.controller'; import { TypeOrmModule } from '@nestjs/typeorm'; @@ -22,7 +22,7 @@ import { Visited } from 'src/visited/entities/visited.entity'; import { UserResetCode } from 'src/auth/user/entities/user-reset-code.entity'; import { UserConfirmCode } from 'src/auth/user/entities/user-confirm-code.entity'; import { EmailService } from 'src/email/email.service'; - +import { VisitedModule } from 'src/visited/visited.module'; @Module({ controllers: [RouteController], providers: [ @@ -38,8 +38,9 @@ import { EmailService } from 'src/email/email.service'; EmailService, ], imports: [ + forwardRef(() => VisitedModule), TypeOrmModule.forFeature([ - Route, + Route, // Asegúrate de incluir la entidad Route aquí User, UserResetCode, Category, @@ -52,5 +53,6 @@ import { EmailService } from 'src/email/email.service'; UserConfirmCode, ]), ], + exports: [RouteService], // Exportar RouteService y TypeOrmModule }) export class RouteModule {} diff --git a/backend/src/visited/visited.module.ts b/backend/src/visited/visited.module.ts index 66ca532f4c09506d47f1f69c83e72879d2ed2d9d..06338f6cc63a1b0f2af04432e5285d0d9a0dce7e 100644 --- a/backend/src/visited/visited.module.ts +++ b/backend/src/visited/visited.module.ts @@ -35,7 +35,7 @@ import { RouteService } from 'src/route/route.service'; EmailService, ], imports: [ - RouteModule, + forwardRef(() => RouteModule), TypeOrmModule.forFeature([ User, Place, diff --git a/backend/src/visited/visited.service.ts b/backend/src/visited/visited.service.ts index 202954b9534132fb9de7b47817743fb3ff57d2e0..e2a868607b8d1f6a02576ddc175d816f11861e3a 100644 --- a/backend/src/visited/visited.service.ts +++ b/backend/src/visited/visited.service.ts @@ -11,12 +11,14 @@ import { LANGUAGES } from 'src/shared/enum/languages.enum'; import { VisitedPlacesImageCreator } from './utils/visited_places_image_creator'; import { ServerConstants } from 'src/constants/server.contants'; import { TravelPlace } from 'src/travel-place/entities/travel-place.entity'; +import { Inject, forwardRef } from '@nestjs/common'; + import { RouteService } from 'src/route/route.service'; @Injectable() export class VisitedService { constructor( - private readonly routeService: RouteService, + @Inject(forwardRef(() => RouteService)) private readonly routeService: RouteService, @InjectRepository(Visited) private visitedRepository: Repository, private readonly userService: UserService, private readonly placeService: PlaceService,