aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/account.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-07 14:34:16 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-10 14:02:41 +0200
commit4f32032fed8587ea97d45e235b167e8958efd81f (patch)
tree6ec4ce2d5d05a275fb7eeaf3aee33c2b69ebc043 /server/models/account/account.ts
parent57f6896f67cfc570cf3605dd94b0778101b2d9b9 (diff)
downloadPeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.tar.gz
PeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.tar.zst
PeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.zip
Add migrations
Diffstat (limited to 'server/models/account/account.ts')
-rw-r--r--server/models/account/account.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts
index 466d6258e..f97519b14 100644
--- a/server/models/account/account.ts
+++ b/server/models/account/account.ts
@@ -42,6 +42,7 @@ export enum ScopeNames {
42} 42}
43 43
44export type SummaryOptions = { 44export type SummaryOptions = {
45 actorRequired?: boolean // Default: true
45 whereActor?: WhereOptions 46 whereActor?: WhereOptions
46 withAccountBlockerIds?: number[] 47 withAccountBlockerIds?: number[]
47} 48}
@@ -65,12 +66,12 @@ export type SummaryOptions = {
65 } 66 }
66 67
67 const query: FindOptions = { 68 const query: FindOptions = {
68 attributes: [ 'id', 'name' ], 69 attributes: [ 'id', 'name', 'actorId' ],
69 include: [ 70 include: [
70 { 71 {
71 attributes: [ 'id', 'preferredUsername', 'url', 'serverId', 'avatarId' ], 72 attributes: [ 'id', 'preferredUsername', 'url', 'serverId', 'avatarId' ],
72 model: ActorModel.unscoped(), 73 model: ActorModel.unscoped(),
73 required: true, 74 required: options.actorRequired ?? true,
74 where: whereActor, 75 where: whereActor,
75 include: [ 76 include: [
76 serverInclude, 77 serverInclude,