import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type'
import { values } from 'lodash'
import { NSFW_POLICY_TYPES } from '../../initializers'
+import { VideoFileModel } from '../video/video-file'
enum ScopeNames {
WITH_VIDEO_CHANNEL = 'WITH_VIDEO_CHANNEL'
return parseInt(total, 10)
})
}
+
+ static autocomplete (search: string) {
+ return UserModel.findAll({
+ where: {
+ username: {
+ [Sequelize.Op.like]: `%${search}%`
+ }
+ }
+ })
+ .then(u => u.map(u => u.username))
+ }
}