Correction filtrage API

This commit is contained in:
Emmy D'Anello 2024-12-12 15:37:26 +01:00
parent 246dae446f
commit a4a0981b2c
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 6 additions and 6 deletions

View File

@ -37,8 +37,8 @@ export class GeolocationsController {
@UseGuards(JwtAuthGuard) @UseGuards(JwtAuthGuard)
@ApiBearerAuth() @ApiBearerAuth()
@ApiOkResponsePaginated(GeolocationEntity) @ApiOkResponsePaginated(GeolocationEntity)
async findAll(@Query() queryPagination?: QueryPaginationDto, @Query() playerFilter?: PlayerFilterDto): Promise<PaginateOutputDto<GeolocationEntity>> { async findAll(@Query() queryPagination: QueryPaginationDto, @Query() { playerId }: PlayerFilterDto): Promise<PaginateOutputDto<GeolocationEntity>> {
const [geolocations, total] = await this.geolocationsService.findAll(queryPagination, playerFilter) const [geolocations, total] = await this.geolocationsService.findAll(queryPagination, { playerId })
return paginateOutput<GeolocationEntity>(geolocations.map(geolocation => new GeolocationEntity(geolocation)), total, queryPagination) return paginateOutput<GeolocationEntity>(geolocations.map(geolocation => new GeolocationEntity(geolocation)), total, queryPagination)
} }

View File

@ -38,8 +38,8 @@ export class MoneyUpdatesController {
@UseGuards(JwtAuthGuard) @UseGuards(JwtAuthGuard)
@ApiBearerAuth() @ApiBearerAuth()
@ApiOkResponsePaginated(MoneyUpdateEntity) @ApiOkResponsePaginated(MoneyUpdateEntity)
async findAll(@Query() queryPagination: QueryPaginationDto, @Query() playerFilter: PlayerFilterDto): Promise<PaginateOutputDto<MoneyUpdateEntity>> { async findAll(@Query() queryPagination: QueryPaginationDto, @Query() { playerId }: PlayerFilterDto): Promise<PaginateOutputDto<MoneyUpdateEntity>> {
const [trains, total] = await this.moneyUpdatesService.findAll(queryPagination, playerFilter) const [trains, total] = await this.moneyUpdatesService.findAll(queryPagination, { playerId })
return paginateOutput<MoneyUpdateEntity>(trains.map(train => new MoneyUpdateEntity(train)), total, queryPagination) return paginateOutput<MoneyUpdateEntity>(trains.map(train => new MoneyUpdateEntity(train)), total, queryPagination)
} }

View File

@ -41,8 +41,8 @@ export class TrainsController {
@UseGuards(JwtAuthGuard) @UseGuards(JwtAuthGuard)
@ApiBearerAuth() @ApiBearerAuth()
@ApiOkResponsePaginated(TrainEntity) @ApiOkResponsePaginated(TrainEntity)
async findAll(@Query() queryPagination: QueryPaginationDto, @Query() playerFilter: PlayerFilterDto): Promise<PaginateOutputDto<TrainEntity>> { async findAll(@Query() queryPagination: QueryPaginationDto, @Query() { playerId }: PlayerFilterDto): Promise<PaginateOutputDto<TrainEntity>> {
const [trains, total] = await this.trainsService.findAll(queryPagination, playerFilter) const [trains, total] = await this.trainsService.findAll(queryPagination, { playerId })
return paginateOutput<TrainEntity>(trains.map(train => new TrainEntity(train)), total, queryPagination) return paginateOutput<TrainEntity>(trains.map(train => new TrainEntity(train)), total, queryPagination)
} }