ForeignKey,
HasMany,
Is,
- Model, Scopes,
+ Model,
+ Scopes,
Table,
UpdatedAt
} from 'sequelize-typescript'
import { VideoChannelModel } from '../video/video-channel'
import { VideoCommentModel } from '../video/video-comment'
import { UserModel } from './user'
-import { CONFIG } from '../../initializers'
import { AvatarModel } from '../avatar/avatar'
-import { WhereOptions } from 'sequelize'
import { VideoPlaylistModel } from '../video/video-playlist'
+import { WEBSERVER } from '../../initializers/constants'
export enum ScopeNames {
SUMMARY = 'SUMMARY'
]
})
@Scopes({
- [ ScopeNames.SUMMARY ]: (whereActor?: WhereOptions<ActorModel>) => {
+ [ ScopeNames.SUMMARY ]: (whereActor?: Sequelize.WhereOptions<ActorModel>) => {
return {
attributes: [ 'id', 'name' ],
include: [
static loadByNameWithHost (nameWithHost: string) {
const [ accountName, host ] = nameWithHost.split('@')
- if (!host || host === CONFIG.WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName)
+ if (!host || host === WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName)
return AccountModel.loadByNameAndHost(accountName, host)
}