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