Skip to content

Commit 064c19c

Browse files
committed
Added currentCountQuery for newsletters
refs TryGhost/Product#1583
1 parent 8b4f442 commit 064c19c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/limit-service/lib/config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ module.exports = {
99
return result.count;
1010
}
1111
},
12-
newsletters: {},
12+
newsletters: {
13+
currentCountQuery: async (db) => {
14+
let result = await db.knex('newsletters')
15+
.count('id', {as: 'count'})
16+
.where('status', '=', 'active')
17+
.first();
18+
19+
return result.count;
20+
}
21+
},
1322
emails: {
1423
currentCountQuery: async (db, startDate) => {
1524
let result = await db.knex('emails')

0 commit comments

Comments
 (0)