]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/helpers/actor.ts
emit more specific status codes on video upload (#3423)
[github/Chocobozzz/PeerTube.git] / server / helpers / actor.ts
CommitLineData
e587e0ec 1import { ActorModel } from '../models/activitypub/actor'
453e83ea 2import * as Bluebird from 'bluebird'
26d6bf65 3import { MActorFull, MActorAccountChannelId } from '../types/models'
e587e0ec 4
453e83ea
C
5type ActorFetchByUrlType = 'all' | 'association-ids'
6
7function fetchActorByUrl (url: string, fetchType: ActorFetchByUrlType): Bluebird<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}