]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | import { ActorModel } from '../models/activitypub/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 | } |