]>
Commit | Line | Data |
---|---|---|
eb66ee88 C |
1 | import { Memoize } from '@server/helpers/memoize' |
2 | import { ServerModel } from '@server/models/server/server' | |
3 | import { ActorModel } from '../../actor' | |
4 | import { ActorFollowModel } from '../../actor-follow' | |
5 | import { ActorImageModel } from '../../actor-image' | |
6 | ||
bae61627 C |
7 | export class ActorFollowTableAttributes { |
8 | ||
eb66ee88 | 9 | @Memoize() |
bae61627 | 10 | getFollowAttributes () { |
eb66ee88 | 11 | return ActorFollowModel.getSQLAttributes('ActorFollowModel').join(', ') |
bae61627 C |
12 | } |
13 | ||
eb66ee88 | 14 | @Memoize() |
bae61627 | 15 | getActorAttributes (actorTableName: string) { |
eb66ee88 | 16 | return ActorModel.getSQLAttributes(actorTableName, `${actorTableName}.`).join(', ') |
bae61627 C |
17 | } |
18 | ||
eb66ee88 | 19 | @Memoize() |
bae61627 | 20 | getServerAttributes (actorTableName: string) { |
eb66ee88 | 21 | return ServerModel.getSQLAttributes(`${actorTableName}->Server`, `${actorTableName}.Server.`).join(', ') |
bae61627 C |
22 | } |
23 | ||
eb66ee88 | 24 | @Memoize() |
bae61627 | 25 | getAvatarAttributes (actorTableName: string) { |
eb66ee88 | 26 | return ActorImageModel.getSQLAttributes(`${actorTableName}->Avatars`, `${actorTableName}.Avatars.`).join(', ') |
bae61627 C |
27 | } |
28 | } |