Fix SQL query

pull/5817/head
Chocobozzz 2023-05-12 09:06:16 +02:00
parent 5752683ea5
commit 65b2ec673d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 6 additions and 6 deletions

View File

@ -311,7 +311,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
if (t.host) {
return {
[Op.and]: [
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
ActorModel.wherePreferredUsername(t.name),
{ $host$: t.host }
]
}
@ -319,7 +319,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
return {
[Op.and]: [
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
ActorModel.wherePreferredUsername(t.name),
{ $serverId$: null }
]
}

View File

@ -381,7 +381,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
const query = {
where: {
[Op.and]: [
this.wherePreferredUsername(preferredUsername),
this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
{
serverId: null
}
@ -431,7 +431,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
static loadByNameAndHost (preferredUsername: string, host: string): Promise<MActorFull> {
const query = {
where: this.wherePreferredUsername(preferredUsername),
where: this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
include: [
{
model: ServerModel,

View File

@ -702,7 +702,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
required: true,
where: {
[Op.and]: [
ActorModel.wherePreferredUsername(name),
ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
{ serverId: null }
]
},
@ -728,7 +728,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
{
model: ActorModel,
required: true,
where: ActorModel.wherePreferredUsername(name),
where: ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
include: [
{
model: ServerModel,