Skip to content

Commit 11526bb

Browse files
🐛 Remove 'UnderControl' supplies from shelter queries
fix/remove-undercontrol-supplies
1 parent 8896fe5 commit 11526bb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/shelter/shelter.service.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
UpdateShelterSchema,
1111
} from './types';
1212
import { SeachQueryProps } from '@/decorators/search-query/types';
13+
import { SupplyPriority } from 'src/supply/types';
1314

1415
@Injectable()
1516
export class ShelterService {
@@ -70,6 +71,11 @@ export class ShelterService {
7071
latitude: true,
7172
longitude: true,
7273
shelterSupplies: {
74+
where: {
75+
priority: {
76+
gt: SupplyPriority.UnderControl,
77+
},
78+
},
7379
select: {
7480
priority: true,
7581
supply: {
@@ -119,6 +125,11 @@ export class ShelterService {
119125
createdAt: true,
120126
updatedAt: true,
121127
shelterSupplies: {
128+
where: {
129+
priority: {
130+
gt: SupplyPriority.UnderControl,
131+
},
132+
},
122133
select: {
123134
priority: true,
124135
supply: {
@@ -193,6 +204,11 @@ export class ShelterService {
193204
createdAt: true,
194205
updatedAt: true,
195206
shelterSupplies: {
207+
where: {
208+
priority: {
209+
gt: SupplyPriority.UnderControl,
210+
},
211+
},
196212
select: {
197213
priority: true,
198214
supply: {

0 commit comments

Comments
 (0)