(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,15 +34,9 @@ router.post('/translations/propose', handleErrorAsync(async (req, res) => {
changes: req.body.changes,
});
if (req.isGranted('translations')) {
for (const { email } of await findAdmins(req.db, global.config.locale, 'code')) {
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');
}));