Fix avatar image in channel page
authorChocobozzz <me@florianbigard.com>
Mon, 18 Jun 2018 09:34:14 +0000 (11:34 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 18 Jun 2018 09:34:14 +0000 (11:34 +0200)
server/models/video/video-channel.ts

index a65a03e3807a9772329ec5b928cfa12047f470ad..4251afce994d00ab7999b2fb92420b36b8d7bec1 100644 (file)
@@ -15,6 +15,7 @@ import { ActorModel } from '../activitypub/actor'
 import { getSort, throwIfNotValid } from '../utils'
 import { VideoModel } from './video'
 import { CONSTRAINTS_FIELDS } from '../../initializers'
+import { AvatarModel } from '../avatar/avatar'
 
 enum ScopeNames {
   WITH_ACCOUNT = 'WITH_ACCOUNT',
@@ -39,7 +40,13 @@ enum ScopeNames {
         include: [
           {
             model: () => ActorModel.unscoped(),
-            required: true
+            required: true,
+            include: [
+              {
+                model: () => AvatarModel.unscoped(),
+                required: false
+              }
+            ]
           }
         ]
       }