@@ -5,6 +5,7 @@ import GameFeedbackPolicy from '../policies/game-feedback.policy'
5
5
import GameFeedbackCategory from '../entities/game-feedback-category'
6
6
import createGameActivity from '../lib/logging/createGameActivity'
7
7
import { GameActivityType } from '../entities/game-activity'
8
+ import { devDataPlayerFilter } from '../middlewares/dev-data-middleware'
8
9
9
10
const itemsPerPage = 50
10
11
@@ -40,14 +41,14 @@ export default class GameFeedbackService extends Service {
40
41
const { feedbackCategoryInternalName, search, page } = req . query
41
42
const em : EntityManager = req . ctx . em
42
43
43
- let query = em . qb ( GameFeedback , 'gf' )
44
+ const query = em . qb ( GameFeedback , 'gf' )
44
45
. select ( 'gf.*' )
45
46
. orderBy ( { createdAt : QueryOrder . DESC } )
46
47
. limit ( itemsPerPage )
47
48
. offset ( Number ( page ) * itemsPerPage )
48
49
49
50
if ( feedbackCategoryInternalName ) {
50
- query = query
51
+ query
51
52
. andWhere ( {
52
53
category : {
53
54
internalName : feedbackCategoryInternalName
@@ -56,7 +57,7 @@ export default class GameFeedbackService extends Service {
56
57
}
57
58
58
59
if ( search ) {
59
- query = query . andWhere ( {
60
+ query . andWhere ( {
60
61
$or : [
61
62
{ comment : { $like : `%${ search } %` } } ,
62
63
{
@@ -69,6 +70,14 @@ export default class GameFeedbackService extends Service {
69
70
} )
70
71
}
71
72
73
+ if ( ! req . ctx . state . includeDevData ) {
74
+ query . andWhere ( {
75
+ playerAlias : {
76
+ player : devDataPlayerFilter ( em )
77
+ }
78
+ } )
79
+ }
80
+
72
81
const [ feedback , count ] = await query
73
82
. andWhere ( {
74
83
category : {
0 commit comments