I have a NestJS controller like this:
@Put('/:id')
updateLocalityInfo(
@Query('type') type: string,
@Body() data: EditLocalityDto,
@Body('parentId', ParseIntPipe) parentId: number,
@Param('id', ParseIntPipe) id: number,
) {
console.log(data);
return this.localitiesService.updateLocalityInformation(
type,
data,
id,
parentId,
);
}
in which I'm getting a bunch of data. however, I'm having issues with the Dto and the parentId variable. When I call this route the parentId
seems to be part of the Dto-data. the console.log shows
{ name: 'exampleName', parentId: '1' }
my dto only has a name:
import { ApiProperty } from '@nestjs/swagger';
export class EditLocalityDto {
@ApiProperty()
name: string;
}
I want to get rid of the parentId being part of the dto-data. how do I do that in general