diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /server/helpers/actor.ts | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'server/helpers/actor.ts')
-rw-r--r-- | server/helpers/actor.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/helpers/actor.ts b/server/helpers/actor.ts new file mode 100644 index 000000000..12a7ace9f --- /dev/null +++ b/server/helpers/actor.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | import { ActorModel } from '../models/activitypub/actor' | ||
2 | |||
3 | type ActorFetchByUrlType = 'all' | 'actor-and-association-ids' | ||
4 | function fetchActorByUrl (url: string, fetchType: ActorFetchByUrlType) { | ||
5 | if (fetchType === 'all') return ActorModel.loadByUrlAndPopulateAccountAndChannel(url) | ||
6 | |||
7 | if (fetchType === 'actor-and-association-ids') return ActorModel.loadByUrl(url) | ||
8 | } | ||
9 | |||
10 | export { | ||
11 | ActorFetchByUrlType, | ||
12 | fetchActorByUrl | ||
13 | } | ||