Loading backend/src/pointOfInterest/PointOfInterest.service.ts +14 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,20 @@ export class PointOfInterestService { if (!place) { throw new BadRequestException('Place not found'); } const idPlace = place.idPlace; const points: getPointDto[] = await this.dataSource .getRepository(PointOfInterestTraduction) .createQueryBuilder('pointTrad') .leftJoin('pointTrad.idPoint', 'point') .select(['point.idPoint as idPoint', 'pointTrad.directions as directions', 'point.idPlace as idPlace']) .where('point.idPlace = :idPlace', { idPlace }) .andWhere('pointTrad.directions IS NULL') .getRawMany(); if (points.length > 0) { throw new BadRequestException('El ultimo punto ha sido registrad'); } const createPointDto: CreatePointDto = { name: createPointAndTradDto.name, imageName: createPointAndTradDto.image, Loading Loading
backend/src/pointOfInterest/PointOfInterest.service.ts +14 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,20 @@ export class PointOfInterestService { if (!place) { throw new BadRequestException('Place not found'); } const idPlace = place.idPlace; const points: getPointDto[] = await this.dataSource .getRepository(PointOfInterestTraduction) .createQueryBuilder('pointTrad') .leftJoin('pointTrad.idPoint', 'point') .select(['point.idPoint as idPoint', 'pointTrad.directions as directions', 'point.idPlace as idPlace']) .where('point.idPlace = :idPlace', { idPlace }) .andWhere('pointTrad.directions IS NULL') .getRawMany(); if (points.length > 0) { throw new BadRequestException('El ultimo punto ha sido registrad'); } const createPointDto: CreatePointDto = { name: createPointAndTradDto.name, imageName: createPointAndTradDto.image, Loading