2020-12-08 08:30:29 -05:00
|
|
|
|
2021-06-03 11:33:44 -04:00
|
|
|
import { ActorModel } from '../../models/actor/actor'
|
|
|
|
import { MActorAccountChannelId, MActorFull } from '../../types/models'
|
2018-09-19 08:44:20 -04:00
|
|
|
|
2021-06-03 12:10:56 -04:00
|
|
|
type ActorLoadByUrlType = 'all' | 'association-ids'
|
2019-08-15 05:53:26 -04:00
|
|
|
|
2021-06-03 12:10:56 -04:00
|
|
|
function loadActorByUrl (url: string, fetchType: ActorLoadByUrlType): Promise<MActorFull | MActorAccountChannelId> {
|
2018-09-19 08:44:20 -04:00
|
|
|
if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url)
|
|
|
|
|
2019-08-15 05:53:26 -04:00
|
|
|
if (fetchType === 'association-ids') return ActorModel.loadByUrl(url)
|
2018-09-19 08:44:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
2021-06-03 12:10:56 -04:00
|
|
|
ActorLoadByUrlType,
|
|
|
|
|
|
|
|
loadActorByUrl
|
2018-09-19 08:44:20 -04:00
|
|
|
}
|