0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed count for redemptions

no-issue

You must use `where` rather than `forge` when generating counts.
This commit is contained in:
Fabien O'Carroll 2021-10-18 14:04:37 +02:00
parent 3cd26bc11b
commit dbf549b664

View file

@ -101,7 +101,7 @@ class OfferRepository {
async mapToOffer(model, options) {
const json = model.toJSON();
const count = await this.OfferRedemptionModel.forge({offer_id: json.id}).count('id', {
const count = await this.OfferRedemptionModel.where({offer_id: json.id}).count('id', {
transacting: options.transacting
});
return Offer.create({