Fix join in video events

This commit is contained in:
Chocobozzz 2017-10-26 11:42:36 +02:00
parent a041b17147
commit b869d19068
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 20 additions and 10 deletions

View File

@ -102,15 +102,20 @@ listWithLimitAndRandom = function (limitPods: number, limitRequestsPerPod: numbe
model: RequestVideoEvent['sequelize'].models.Video,
include: [
{
model: RequestVideoEvent['sequelize'].models.Author,
model: RequestVideoEvent['sequelize'].models.VideoChannel,
include: [
{
model: RequestVideoEvent['sequelize'].models.Pod,
where: {
id: {
$in: podIds
model: RequestVideoEvent['sequelize'].models.Author,
include: [
{
model: RequestVideoEvent['sequelize'].models.Pod,
where: {
id: {
$in: podIds
}
}
}
}
]
}
]
}
@ -138,10 +143,15 @@ removeByRequestIdsAndPod = function (ids: number[], podId: number) {
model: RequestVideoEvent['sequelize'].models.Video,
include: [
{
model: RequestVideoEvent['sequelize'].models.Author,
where: {
podId
}
model: RequestVideoEvent['sequelize'].models.VideoChannel,
include: [
{
model: RequestVideoEvent['sequelize'].models.Author,
where: {
podId
}
}
]
}
]
}