From 851eba3ed61002cb3b9e9fb97dd4a774882536f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Iv=C3=A1n?= <80365304+Diego-lvan@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:11:42 -0600 Subject: [PATCH] fix --- backend/src/route/route.module.ts | 8 +++++--- backend/src/visited/visited.module.ts | 2 +- backend/src/visited/visited.service.ts | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/route/route.module.ts b/backend/src/route/route.module.ts index 14a9b77b..8416b3a8 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 66ca532f..06338f6c 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 202954b9..e2a86860 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, -- GitLab