Add ability to search on domain and username too

This commit is contained in:
Chocobozzz 2018-03-27 15:09:53 +02:00
parent 586f7c1bef
commit 3e0c9ff5d5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 17 additions and 3 deletions

View File

@ -676,9 +676,23 @@ export class VideoModel extends Model<VideoModel> {
limit: count,
order: getSort(sort),
where: {
name: {
[Sequelize.Op.iLike]: '%' + value + '%'
}
[Sequelize.Op.or]: [
{
name: {
[ Sequelize.Op.iLike ]: '%' + value + '%'
}
},
{
preferredUsername: Sequelize.where(Sequelize.col('preferredUsername'), {
[ Sequelize.Op.iLike ]: '%' + value + '%'
})
},
{
host: Sequelize.where(Sequelize.col('host'), {
[ Sequelize.Op.iLike ]: '%' + value + '%'
})
}
]
}
}