diff --git a/client/src/app/shared/shared-main/users/user-notifications.component.ts b/client/src/app/shared/shared-main/users/user-notifications.component.ts
index 387c49d94..2f6ed061a 100644
--- a/client/src/app/shared/shared-main/users/user-notifications.component.ts
+++ b/client/src/app/shared/shared-main/users/user-notifications.component.ts
@@ -21,9 +21,6 @@ export class UserNotificationsComponent implements OnInit {
notifications: UserNotification[] = []
sortField = 'createdAt'
- // So we can access it in the template
- UserNotificationType = UserNotificationType
-
componentPagination: ComponentPagination
onDataSubject = new Subject
()
diff --git a/server/helpers/custom-validators/user-notifications.ts b/server/helpers/custom-validators/user-notifications.ts
index 8a33b895b..252c107db 100644
--- a/server/helpers/custom-validators/user-notifications.ts
+++ b/server/helpers/custom-validators/user-notifications.ts
@@ -1,10 +1,9 @@
-import { exists } from './misc'
import validator from 'validator'
-import { UserNotificationType } from '../../../shared/models/users'
import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
+import { exists } from './misc'
function isUserNotificationTypeValid (value: any) {
- return exists(value) && validator.isInt('' + value) && UserNotificationType[value] !== undefined
+ return exists(value) && validator.isInt('' + value)
}
function isUserNotificationSettingValid (value: any) {
diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts
index e2f2234e4..b04619685 100644
--- a/shared/models/users/user-notification.model.ts
+++ b/shared/models/users/user-notification.model.ts
@@ -1,7 +1,7 @@
import { FollowState } from '../actors'
import { AbuseState } from '../moderation'
-export enum UserNotificationType {
+export const enum UserNotificationType {
NEW_VIDEO_FROM_SUBSCRIPTION = 1,
NEW_COMMENT_ON_MY_VIDEO = 2,
NEW_ABUSE_FOR_MODERATORS = 3,