1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00
Peertube/server/core/lib/model-loaders/actor.ts
2023-10-04 15:13:25 +02:00

16 lines
529 B
TypeScript

import { ActorModel } from '../../models/actor/actor.js'
import { MActorAccountChannelId, MActorFull } from '../../types/models/index.js'
type ActorLoadByUrlType = 'all' | 'association-ids'
function loadActorByUrl (url: string, fetchType: ActorLoadByUrlType): Promise<MActorFull | MActorAccountChannelId> {
if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url)
if (fetchType === 'association-ids') return ActorModel.loadByUrl(url)
}
export {
type ActorLoadByUrlType,
loadActorByUrl
}