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