1
0
Fork 0

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

View file

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