]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/helpers/actor.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / actor.ts
CommitLineData
b49f22d8 1
7d9ba5c0 2import { ActorModel } from '../models/actor/actor'
b49f22d8 3import { MActorAccountChannelId, MActorFull } from '../types/models'
e587e0ec 4
453e83ea
C
5type ActorFetchByUrlType = 'all' | 'association-ids'
6
b49f22d8 7function fetchActorByUrl (url: string, fetchType: ActorFetchByUrlType): Promise<MActorFull | MActorAccountChannelId> {
e587e0ec
C
8 if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url)
9
453e83ea 10 if (fetchType === 'association-ids') return ActorModel.loadByUrl(url)
e587e0ec
C
11}
12
13export {
14 ActorFetchByUrlType,
15 fetchActorByUrl
16}