mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat: allow users to select notification types (#1512)
* feat: allow users to select notification types * fix(ui): display personal notification types before management types * fix: update allRequestsAutoApproved check to account for new REQUEST_MOVIE & REQUEST_TV perms * fix(ui): do not display Discord notif type selector if user not eligible for any types * refactor(ui): remove unnecessary 'enabled' checkboxes from user notif settings * fix(ui): correct checkbox behavior * fix: add missing return type on hasNotificationType * refactor: remove unused isValid prop in NotificationsWebPush * fix(ui): use SensitiveInput for users' public PGP keys * fix(ui): add missing tip/hint for email encryption setting * refactor(svg): use the new Discord logo * revert(api): undo breaking change removing discordEnabled from UserSettingsNotificationsResponse * fix(lang): update notification type descriptions for clarity * fix(telegram): do not send users notifications of their own auto-approved requests
This commit is contained in:
@@ -238,7 +238,7 @@ userSettingsRoutes.get<{ id: string }, UserSettingsNotificationsResponse>(
|
||||
isOwnProfileOrAdmin(),
|
||||
async (req, res, next) => {
|
||||
const userRepository = getRepository(User);
|
||||
const settings = getSettings();
|
||||
const settings = getSettings()?.notifications.agents;
|
||||
|
||||
try {
|
||||
const user = await userRepository.findOne({
|
||||
@@ -250,16 +250,18 @@ userSettingsRoutes.get<{ id: string }, UserSettingsNotificationsResponse>(
|
||||
}
|
||||
|
||||
return res.status(200).json({
|
||||
emailEnabled: settings?.notifications.agents.email.enabled,
|
||||
emailEnabled: settings?.email.enabled,
|
||||
pgpKey: user.settings?.pgpKey,
|
||||
discordEnabled: settings?.notifications.agents.discord.enabled,
|
||||
discordEnabled: settings?.discord.enabled,
|
||||
discordEnabledTypes: settings?.discord.enabled
|
||||
? settings?.discord.types
|
||||
: 0,
|
||||
discordId: user.settings?.discordId,
|
||||
telegramEnabled: settings?.notifications.agents.telegram.enabled,
|
||||
telegramBotUsername:
|
||||
settings?.notifications.agents.telegram.options.botUsername,
|
||||
telegramEnabled: settings?.telegram.enabled,
|
||||
telegramBotUsername: settings?.telegram.options.botUsername,
|
||||
telegramChatId: user.settings?.telegramChatId,
|
||||
telegramSendSilently: user?.settings?.telegramSendSilently,
|
||||
webPushEnabled: settings?.notifications.agents.webpush.enabled,
|
||||
webPushEnabled: settings?.webpush.enabled,
|
||||
notificationTypes: user.settings?.notificationTypes ?? {},
|
||||
});
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user