include sources in notification

This commit is contained in:
Avris 2020-12-06 15:23:18 +01:00
parent b5adceb4bb
commit 6ab0cd8ad9
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@ async function notify() {
const awaitingModeration = [ const awaitingModeration = [
...(await db.all(`SELECT 'nouns' as type, locale, count(*) as c FROM nouns WHERE approved = 0 AND deleted=0 GROUP BY locale`)), ...(await db.all(`SELECT 'nouns' as type, locale, count(*) as c FROM nouns WHERE approved = 0 AND deleted=0 GROUP BY locale`)),
...(await db.all(`SELECT 'inclusive' as type, locale, count(*) as c FROM inclusive WHERE approved = 0 AND deleted=0 GROUP BY locale`)), ...(await db.all(`SELECT 'inclusive' as type, locale, count(*) as c FROM inclusive WHERE approved = 0 AND deleted=0 GROUP BY locale`)),
...(await db.all(`SELECT 'sources' as type, locale, count(*) as c FROM sources WHERE approved = 0 AND deleted=0 GROUP BY locale`)),
]; ];
if (!awaitingModeration.length) { if (!awaitingModeration.length) {
console.log('No entries awaiting moderation'); console.log('No entries awaiting moderation');
@ -29,8 +30,8 @@ async function notify() {
console.log('Sending email to ' + email) console.log('Sending email to ' + email)
mailer( mailer(
email, email,
'[Pronouns] Dictionary entries awaiting moderation: ' + count, '[Pronouns.page] Entries awaiting moderation: ' + count,
'Dictionary entries awaiting moderation: \n' + JSON.stringify(awaitingModerationGrouped, null, 4), 'Entries awaiting moderation: \n' + JSON.stringify(awaitingModerationGrouped, null, 4),
); );
} }
} }