mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Only return active subscriptions
This commit is contained in:
parent
b47d0b4739
commit
49496f7aa2
1 changed files with 1 additions and 5 deletions
|
|
@ -74,6 +74,7 @@ export const subscriptionsResolver = authorized<
|
|||
.leftJoinAndSelect('subscription.newsletterEmail', 'newsletterEmail')
|
||||
.where({
|
||||
user: { id: uid },
|
||||
status: SubscriptionStatus.Active,
|
||||
})
|
||||
|
||||
if (type) {
|
||||
|
|
@ -82,11 +83,6 @@ export const subscriptionsResolver = authorized<
|
|||
})
|
||||
}
|
||||
|
||||
// only return active subscriptions for newsletter
|
||||
if (type === SubscriptionType.Newsletter) {
|
||||
queryBuilder.andWhere({ status: SubscriptionStatus.Active })
|
||||
}
|
||||
|
||||
const subscriptions = await queryBuilder
|
||||
.orderBy('subscription.' + sortBy, sortOrder)
|
||||
.getMany()
|
||||
|
|
|
|||
Loading…
Reference in a new issue