Added setting to enable e-mail on quick alerts.
This commit is contained in:
@@ -580,6 +580,7 @@ const validSettingKeys = [
|
||||
'alertNotificationsEnabled',
|
||||
'alertEmailsEnabled',
|
||||
'alertEmailsFrequency',
|
||||
'quickAlertEmails',
|
||||
];
|
||||
|
||||
export async function updateSettings(settings, reqUser) {
|
||||
@@ -593,6 +594,10 @@ export async function updateSettings(settings, reqUser) {
|
||||
throw new HttpError(`Invalid settings: ${invalidKeys.join()}`, 400);
|
||||
}
|
||||
|
||||
if (Object.hasOwn(settings, 'quickAlertEmails') && typeof settings.quickAlertEmails !== 'boolean') {
|
||||
throw new HttpError('Invalid quick alert e-mails setting', 400);
|
||||
}
|
||||
|
||||
if (settings.alertEmailsFrequency && !['instant', 'daily', 'weekly', 'monthly'].includes(settings.alertEmailsFrequency)) {
|
||||
throw new HttpError('Invalid email frequency setting', 400);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user