Skip to content

Commit 96a71fb

Browse files
Get all currently active offers endpoint only returns non-pending offers.
Co-authored-by: Francisco Cardoso <FranciscoCardoso913@users.noreply.github.com>
1 parent 0d10252 commit 96a71fb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/models/Offer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ OfferSchema.query.current = function() {
167167
return this.where(this.model.filterCurrent());
168168
};
169169

170+
OfferSchema.query.notPending= function(){
171+
return this.where({ isPending: false });
172+
}
173+
170174
/**
171175
* Currently active and non-hidden Offers
172176
*/

src/services/offer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class OfferService {
222222
} = this.decodeQueryToken(queryToken);
223223

224224
[queryValue, queryFilters] = [searchInfo.value, searchInfo.filters];
225-
225+
226226
offers = this._buildSearchContinuationQuery(lastOfferId, lastOfferScore, queryValue,
227227
showHidden, showAdminReason, queryFilters);
228228
} else {
@@ -346,6 +346,7 @@ class OfferService {
346346

347347
selectSearchOffers(offers, showHidden, showAdminReason) {
348348
offers.current();
349+
offers.notPending();
349350
if (!showHidden) offers.withoutHidden();
350351
if (!showAdminReason) offers.select("-adminReason");
351352

0 commit comments

Comments
 (0)