Add type filter

This commit is contained in:
Jackson Harper 2023-08-29 20:06:28 +08:00
parent 3565c7000e
commit 6c1484cd09

View file

@ -81,19 +81,19 @@ export const subscriptionsResolver = authorized<
queryBuilder.andWhere({
type,
})
} else {
queryBuilder.andWhere(
new Brackets((qb) => {
qb.where({
type: SubscriptionType.Newsletter,
status: SubscriptionStatus.Active,
}).orWhere({
type: SubscriptionType.Rss,
})
})
)
}
queryBuilder.andWhere(
new Brackets((qb) => {
qb.where({
type: SubscriptionType.Newsletter,
status: SubscriptionStatus.Active,
}).orWhere({
type: SubscriptionType.Rss,
})
})
)
const subscriptions = await queryBuilder
.orderBy('subscription.' + sortBy, sortOrder)
.getMany()