This commit is contained in:
Philipinho
2026-03-31 00:35:33 +01:00
parent 6fcdebc178
commit d034fce11b
3 changed files with 13 additions and 4 deletions
@@ -9,3 +9,10 @@ export const NotificationType = {
export type NotificationType =
(typeof NotificationType)[keyof typeof NotificationType];
export type NotificationSettingKey =
| 'page.updated'
| 'page.user_mention'
| 'comment.user_mention'
| 'comment.created'
| 'comment.resolved';
+3 -2
View File
@@ -7,6 +7,7 @@ import {
UnauthorizedException,
} from '@nestjs/common';
import { UpdateUserDto } from './dto/update-user.dto';
import { NotificationSettingKey } from '../notification/notification.constants';
import { comparePasswordHash, diffAuditTrackedFields } from 'src/common/helpers/utils';
import { Workspace } from '@docmost/db/types/entity.types';
import { validateSsoEnforcement } from '../auth/auth.util';
@@ -60,7 +61,7 @@ export class UserService {
);
}
const notificationSettings: Record<string, string> = {
const notificationSettings: Record<string, NotificationSettingKey> = {
notificationPageUpdates: 'page.updated',
notificationPageUserMention: 'page.user_mention',
notificationCommentUserMention: 'comment.user_mention',
@@ -72,7 +73,7 @@ export class UserService {
if (typeof updateUserDto[dtoField] !== 'undefined') {
return this.userRepo.updateNotificationSetting(
userId,
settingKey as any,
settingKey,
updateUserDto[dtoField],
);
}