mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Added currentCountQuery for emails limit
refs https://github.com/TryGhost/Team/issues/588 - This is a basic implementation which needs a review. Implemented it to fix failing tests in main - Start date is expected to come formatted for DB's needs
This commit is contained in:
parent
0d242b96ef
commit
ebfad4bea4
@ -9,7 +9,16 @@ module.exports = {
|
||||
return result.count;
|
||||
}
|
||||
},
|
||||
emails: {},
|
||||
emails: {
|
||||
currentCountQuery: async (db, startDate) => {
|
||||
let result = await db.knex('emails')
|
||||
.count('id', {as: 'count'})
|
||||
.where('created_at', '>=', startDate)
|
||||
.first();
|
||||
|
||||
return result.count;
|
||||
}
|
||||
},
|
||||
staff: {
|
||||
currentCountQuery: async (db) => {
|
||||
let result = await db.knex('users')
|
||||
|
Loading…
Reference in New Issue
Block a user