From 67703098b203d869464b893206f1033b91eaaf1e Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Wed, 3 Jul 2024 10:19:28 +0200 Subject: [PATCH] mondo supports isPicked restriction --- src/adverts/repository/mongo/filters/map-restrictions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/adverts/repository/mongo/filters/map-restrictions.ts b/src/adverts/repository/mongo/filters/map-restrictions.ts index 99af9a7..8f7cfba 100644 --- a/src/adverts/repository/mongo/filters/map-restrictions.ts +++ b/src/adverts/repository/mongo/filters/map-restrictions.ts @@ -92,5 +92,10 @@ export const mapRestrictions = ( }, restrictions?.hasReservations === false && { 'meta.reservedCount': 0 }, restrictions?.hasCollects === true && { 'meta.collectedCount': { $gt: 0 } }, - restrictions?.hasCollects === false && { 'meta.collectedCount': 0 } + restrictions?.hasCollects === false && { 'meta.collectedCount': 0 }, + + restrictions?.isPicked === true && { 'advert.pickedAt': { $gt: '' } }, + restrictions?.isPicked === false && { + 'advert.pickedAt': { $not: { $gt: '' } }, + } )