(admin) always send notifications about proposed translations to translations role, not code role

code role cannot do anything yet, because they are not mergeable
This commit is contained in:
Valentyne Stigloher 2024-03-08 12:55:54 +01:00
parent 8257173dbe
commit c4086e1cde

View File

@ -34,14 +34,8 @@ router.post('/translations/propose', handleErrorAsync(async (req, res) => {
changes: req.body.changes, changes: req.body.changes,
}); });
if (req.isGranted('translations')) { for (const { email } of await findAdmins(req.db, global.config.locale, 'translations')) {
for (const { email } of await findAdmins(req.db, global.config.locale, 'code')) { await deduplicateEmailPreset(req.db, email, 'translationProposed', { locale: global.config.locale });
await deduplicateEmailPreset(req.db, email, 'translationToMerge', { locale: global.config.locale });
}
} else {
for (const { email } of await findAdmins(req.db, global.config.locale, 'translations')) {
await deduplicateEmailPreset(req.db, email, 'translationProposed', { locale: global.config.locale });
}
} }
return res.json('OK'); return res.json('OK');