diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:09:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:56:08 +0100 |
commit | 8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa (patch) | |
tree | 4e7d3711cccb095d4356c59554bdfd4e16502832 /server/models/user | |
parent | a8749f7c3b137f433e6944bb99fd721a6f0cfc1e (diff) | |
download | PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.gz PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.zst PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.zip |
Refactor model utils
Diffstat (limited to 'server/models/user')
-rw-r--r-- | server/models/user/sql/user-notitication-list-query-builder.ts | 2 | ||||
-rw-r--r-- | server/models/user/user-notification-setting.ts | 2 | ||||
-rw-r--r-- | server/models/user/user-notification.ts | 2 | ||||
-rw-r--r-- | server/models/user/user.ts | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/server/models/user/sql/user-notitication-list-query-builder.ts b/server/models/user/sql/user-notitication-list-query-builder.ts index 31b4932bf..d11546df0 100644 --- a/server/models/user/sql/user-notitication-list-query-builder.ts +++ b/server/models/user/sql/user-notitication-list-query-builder.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Sequelize } from 'sequelize' | 1 | import { Sequelize } from 'sequelize' |
2 | import { AbstractRunQuery, ModelBuilder } from '@server/models/shared' | 2 | import { AbstractRunQuery, ModelBuilder } from '@server/models/shared' |
3 | import { getSort } from '@server/models/utils' | ||
4 | import { UserNotificationModelForApi } from '@server/types/models' | 3 | import { UserNotificationModelForApi } from '@server/types/models' |
5 | import { ActorImageType } from '@shared/models' | 4 | import { ActorImageType } from '@shared/models' |
5 | import { getSort } from '../../shared' | ||
6 | 6 | ||
7 | export interface ListNotificationsOptions { | 7 | export interface ListNotificationsOptions { |
8 | userId: number | 8 | userId: number |
diff --git a/server/models/user/user-notification-setting.ts b/server/models/user/user-notification-setting.ts index 66e1d85b3..394494c0c 100644 --- a/server/models/user/user-notification-setting.ts +++ b/server/models/user/user-notification-setting.ts | |||
@@ -17,7 +17,7 @@ import { MNotificationSettingFormattable } from '@server/types/models' | |||
17 | import { AttributesOnly } from '@shared/typescript-utils' | 17 | import { AttributesOnly } from '@shared/typescript-utils' |
18 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' | 18 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' |
19 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' | 19 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' |
20 | import { throwIfNotValid } from '../utils' | 20 | import { throwIfNotValid } from '../shared' |
21 | import { UserModel } from './user' | 21 | import { UserModel } from './user' |
22 | 22 | ||
23 | @Table({ | 23 | @Table({ |
diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.ts index d37fa5dc7..6e134158f 100644 --- a/server/models/user/user-notification.ts +++ b/server/models/user/user-notification.ts | |||
@@ -13,7 +13,7 @@ import { AccountModel } from '../account/account' | |||
13 | import { ActorFollowModel } from '../actor/actor-follow' | 13 | import { ActorFollowModel } from '../actor/actor-follow' |
14 | import { ApplicationModel } from '../application/application' | 14 | import { ApplicationModel } from '../application/application' |
15 | import { PluginModel } from '../server/plugin' | 15 | import { PluginModel } from '../server/plugin' |
16 | import { throwIfNotValid } from '../utils' | 16 | import { throwIfNotValid } from '../shared' |
17 | import { VideoModel } from '../video/video' | 17 | import { VideoModel } from '../video/video' |
18 | import { VideoBlacklistModel } from '../video/video-blacklist' | 18 | import { VideoBlacklistModel } from '../video/video-blacklist' |
19 | import { VideoCommentModel } from '../video/video-comment' | 19 | import { VideoCommentModel } from '../video/video-comment' |
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 672728a2a..0932a367a 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -30,6 +30,7 @@ import { | |||
30 | MUserNotifSettingChannelDefault, | 30 | MUserNotifSettingChannelDefault, |
31 | MUserWithNotificationSetting | 31 | MUserWithNotificationSetting |
32 | } from '@server/types/models' | 32 | } from '@server/types/models' |
33 | import { forceNumber } from '@shared/core-utils' | ||
33 | import { AttributesOnly } from '@shared/typescript-utils' | 34 | import { AttributesOnly } from '@shared/typescript-utils' |
34 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' | 35 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' |
35 | import { AbuseState, MyUser, UserRight, VideoPlaylistType } from '../../../shared/models' | 36 | import { AbuseState, MyUser, UserRight, VideoPlaylistType } from '../../../shared/models' |
@@ -63,14 +64,13 @@ import { ActorModel } from '../actor/actor' | |||
63 | import { ActorFollowModel } from '../actor/actor-follow' | 64 | import { ActorFollowModel } from '../actor/actor-follow' |
64 | import { ActorImageModel } from '../actor/actor-image' | 65 | import { ActorImageModel } from '../actor/actor-image' |
65 | import { OAuthTokenModel } from '../oauth/oauth-token' | 66 | import { OAuthTokenModel } from '../oauth/oauth-token' |
66 | import { getAdminUsersSort, throwIfNotValid } from '../utils' | 67 | import { getAdminUsersSort, throwIfNotValid } from '../shared' |
67 | import { VideoModel } from '../video/video' | 68 | import { VideoModel } from '../video/video' |
68 | import { VideoChannelModel } from '../video/video-channel' | 69 | import { VideoChannelModel } from '../video/video-channel' |
69 | import { VideoImportModel } from '../video/video-import' | 70 | import { VideoImportModel } from '../video/video-import' |
70 | import { VideoLiveModel } from '../video/video-live' | 71 | import { VideoLiveModel } from '../video/video-live' |
71 | import { VideoPlaylistModel } from '../video/video-playlist' | 72 | import { VideoPlaylistModel } from '../video/video-playlist' |
72 | import { UserNotificationSettingModel } from './user-notification-setting' | 73 | import { UserNotificationSettingModel } from './user-notification-setting' |
73 | import { forceNumber } from '@shared/core-utils' | ||
74 | 74 | ||
75 | enum ScopeNames { | 75 | enum ScopeNames { |
76 | FOR_ME_API = 'FOR_ME_API', | 76 | FOR_ME_API = 'FOR_ME_API', |