mirror of https://github.com/Chocobozzz/PeerTube
Fix SQL query
parent
5752683ea5
commit
65b2ec673d
|
@ -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 }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue