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) {
|
if (t.host) {
|
||||||
return {
|
return {
|
||||||
[Op.and]: [
|
[Op.and]: [
|
||||||
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
|
ActorModel.wherePreferredUsername(t.name),
|
||||||
{ $host$: t.host }
|
{ $host$: t.host }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[Op.and]: [
|
[Op.and]: [
|
||||||
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
|
ActorModel.wherePreferredUsername(t.name),
|
||||||
{ $serverId$: null }
|
{ $serverId$: null }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,7 +381,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
|
||||||
const query = {
|
const query = {
|
||||||
where: {
|
where: {
|
||||||
[Op.and]: [
|
[Op.and]: [
|
||||||
this.wherePreferredUsername(preferredUsername),
|
this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
|
||||||
{
|
{
|
||||||
serverId: null
|
serverId: null
|
||||||
}
|
}
|
||||||
|
@ -431,7 +431,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
|
||||||
|
|
||||||
static loadByNameAndHost (preferredUsername: string, host: string): Promise<MActorFull> {
|
static loadByNameAndHost (preferredUsername: string, host: string): Promise<MActorFull> {
|
||||||
const query = {
|
const query = {
|
||||||
where: this.wherePreferredUsername(preferredUsername),
|
where: this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: ServerModel,
|
model: ServerModel,
|
||||||
|
|
|
@ -702,7 +702,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
|
||||||
required: true,
|
required: true,
|
||||||
where: {
|
where: {
|
||||||
[Op.and]: [
|
[Op.and]: [
|
||||||
ActorModel.wherePreferredUsername(name),
|
ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
|
||||||
{ serverId: null }
|
{ serverId: null }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -728,7 +728,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
|
||||||
{
|
{
|
||||||
model: ActorModel,
|
model: ActorModel,
|
||||||
required: true,
|
required: true,
|
||||||
where: ActorModel.wherePreferredUsername(name),
|
where: ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: ServerModel,
|
model: ServerModel,
|
||||||
|
|
Loading…
Reference in New Issue