]>
Commit | Line | Data |
---|---|---|
e587e0ec | 1 | import { ActorModel } from '../models/activitypub/actor' |
453e83ea | 2 | import * as Bluebird from 'bluebird' |
26d6bf65 | 3 | import { MActorFull, MActorAccountChannelId } from '../types/models' |
e587e0ec | 4 | |
453e83ea C |
5 | type ActorFetchByUrlType = 'all' | 'association-ids' |
6 | ||
7 | function 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 | ||
13 | export { | |
14 | ActorFetchByUrlType, | |
15 | fetchActorByUrl | |
16 | } |