@@ -22,6 +22,7 @@ import {
2222import { InjectRepository } from "@nestjs/typeorm" ;
2323import { Response } from "express" ;
2424import {
25+ FilterOperator ,
2526 Paginate ,
2627 PaginateQuery ,
2728 Paginated ,
@@ -31,6 +32,7 @@ import {
3132import { Repository } from "typeorm" ;
3233
3334import { isArray } from "lodash" ;
35+ import { FilterSuffix } from "nestjs-paginate/lib/filter" ;
3436import configuration from "../../configuration" ;
3537import { MinimumRole } from "../../decorators/minimum-role.decorator" ;
3638import { PaginateQueryOptions } from "../../decorators/pagination.decorator" ;
@@ -101,7 +103,7 @@ export class GamesController {
101103 const rawFilterValue = progressStateFilter . split ( ":" ) . pop ( ) ;
102104 query . filter [ "progresses.state" ] = [
103105 "$null" ,
104- `$or:$in :${ rawFilterValue } ` ,
106+ `$or:$eq :${ rawFilterValue } ` ,
105107 ] ;
106108 }
107109
@@ -110,7 +112,6 @@ export class GamesController {
110112 query . filter [ "progresses.user.id" ] = [
111113 "$null" ,
112114 `$or:$not:${ rawFilterValue } ` ,
113- `$or:$eq:${ rawFilterValue } ` ,
114115 ] ;
115116 }
116117 }
@@ -173,8 +174,16 @@ export class GamesController {
173174 "metadata.genres.name" : true ,
174175 "metadata.tags.name" : true ,
175176 "metadata.age_rating" : true ,
176- "progresses.state" : true ,
177- "progresses.user.id" : true ,
177+ "progresses.state" : [
178+ FilterOperator . EQ ,
179+ FilterOperator . NULL ,
180+ FilterSuffix . NOT ,
181+ ] ,
182+ "progresses.user.id" : [
183+ FilterOperator . EQ ,
184+ FilterOperator . NULL ,
185+ FilterSuffix . NOT ,
186+ ] ,
178187 } ,
179188 withDeleted : false ,
180189 } ) ;
0 commit comments