Correction filtrage API
This commit is contained in:
parent
246dae446f
commit
a4a0981b2c
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user