]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/model-loaders/actor.ts
Add x-powered-by header
[github/Chocobozzz/PeerTube.git] / server / lib / model-loaders / actor.ts
CommitLineData
b49f22d8 1
10363c74
C
2import { ActorModel } from '../../models/actor/actor'
3import { MActorAccountChannelId, MActorFull } from '../../types/models'
e587e0ec 4
868fce62 5type ActorLoadByUrlType = 'all' | 'association-ids'
453e83ea 6
868fce62 7function loadActorByUrl (url: string, fetchType: ActorLoadByUrlType): 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
13export {
868fce62
C
14 ActorLoadByUrlType,
15
16 loadActorByUrl
e587e0ec 17}