const followWhere = state ? { state } : {}
const followingWhere: WhereOptions = {}
- const followingServerWhere: WhereOptions = {}
if (search) {
- Object.assign(followingServerWhere, {
- host: {
- [Op.iLike]: '%' + search + '%'
- }
+ Object.assign(followWhere, {
+ [Op.or]: [
+ searchAttribute(options.search, '$ActorFollowing.preferredUsername$'),
+ searchAttribute(options.search, '$ActorFollowing.Server.host$')
+ ]
})
}
include: [
{
model: ServerModel,
- required: true,
- where: followingServerWhere
+ required: true
}
]
}
const followWhere = state ? { state } : {}
const followerWhere: WhereOptions = {}
- const followerServerWhere: WhereOptions = {}
if (search) {
- Object.assign(followerServerWhere, {
- host: {
- [Op.iLike]: '%' + search + '%'
- }
+ Object.assign(followWhere, {
+ [Op.or]: [
+ searchAttribute(search, '$ActorFollower.preferredUsername$'),
+ searchAttribute(search, '$ActorFollower.Server.host$')
+ ]
})
}
include: [
{
model: ServerModel,
- required: true,
- where: followerServerWhere
+ required: true
}
]
},