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 registrado. Para agregar más, cambia el último punto'); } const createPointDto: CreatePointDto = { name: createPointAndTradDto.name, imageName: createPointAndTradDto.image, Loading backend/src/pointOfInterest/dto/create-pointAndTraduction.dto.ts +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ export class CreatePointAndTradDto { @ApiProperty() contentES: string; @ApiProperty() directionsEN: string; directionsEN?: string; @ApiProperty() directionsES: string; directionsES?: string; } backend/src/pointOfInterest/dto/create-pointTrad.dto.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ export class CreatePointTradDto { language: LANGUAGES; idPoint: number; content: string; directions: string; directions?: string; audioName: string; } backend/src/pointOfInterest/dto/getPoint.dto.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ export class getPointDto { name: string; imageName: string; content: string; directions: string; directions?: string; } web/src/data/datasource/api/entities/poi.ts +2 −2 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ export interface PointOfInterest { image: File | string; contentEN: string; contentES: string; directionsEN: string; directionsES: string; directionsEN?: string; directionsES?: string; } /** 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 registrado. Para agregar más, cambia el último punto'); } const createPointDto: CreatePointDto = { name: createPointAndTradDto.name, imageName: createPointAndTradDto.image, Loading
backend/src/pointOfInterest/dto/create-pointAndTraduction.dto.ts +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ export class CreatePointAndTradDto { @ApiProperty() contentES: string; @ApiProperty() directionsEN: string; directionsEN?: string; @ApiProperty() directionsES: string; directionsES?: string; }
backend/src/pointOfInterest/dto/create-pointTrad.dto.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,6 @@ export class CreatePointTradDto { language: LANGUAGES; idPoint: number; content: string; directions: string; directions?: string; audioName: string; }
backend/src/pointOfInterest/dto/getPoint.dto.ts +1 −1 Original line number Diff line number Diff line Loading @@ -4,5 +4,5 @@ export class getPointDto { name: string; imageName: string; content: string; directions: string; directions?: string; }
web/src/data/datasource/api/entities/poi.ts +2 −2 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ export interface PointOfInterest { image: File | string; contentEN: string; contentES: string; directionsEN: string; directionsES: string; directionsEN?: string; directionsES?: string; } /** Loading