File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class ShelterSearch {
13
13
}
14
14
15
15
get priority ( ) : Prisma . ShelterWhereInput [ ] {
16
- if ( this . data . priority !== null ) {
16
+ if ( this . data . priority ) {
17
17
return [
18
18
{
19
19
shelterSupplies : {
@@ -102,15 +102,17 @@ class ShelterSearch {
102
102
103
103
get query ( ) : Prisma . ShelterWhereInput {
104
104
if ( Object . keys ( this . data ) . length === 0 ) return { } ;
105
- return {
106
- OR : [
107
- ...this . search ,
108
- ...this . shelterStatus ,
105
+ const queryData = {
106
+ AND : [
107
+ { OR : this . search } ,
108
+ { OR : this . shelterStatus } ,
109
+ { OR : this . priority } ,
109
110
this . supplyCategoryIds ,
110
111
this . supplyIds ,
111
- ...this . search ,
112
112
] ,
113
113
} ;
114
+ console . log ( JSON . stringify ( queryData , null , 2 ) ) ;
115
+ return queryData ;
114
116
}
115
117
}
116
118
You can’t perform that action at this time.
0 commit comments