diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-28 11:37:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-28 11:37:32 +0100 |
commit | b8f4167fb6fa448125aeecff80b201d74e27fe6a (patch) | |
tree | 33179fe38e113b3bd88bae9782f4741754a85159 /server/helpers/custom-validators/follows.ts | |
parent | d275e75453015352d5b9387eaf5078e1ba5e0ea2 (diff) | |
download | PeerTube-b8f4167fb6fa448125aeecff80b201d74e27fe6a.tar.gz PeerTube-b8f4167fb6fa448125aeecff80b201d74e27fe6a.tar.zst PeerTube-b8f4167fb6fa448125aeecff80b201d74e27fe6a.zip |
Only display accepted followers/followings in about page
Diffstat (limited to 'server/helpers/custom-validators/follows.ts')
-rw-r--r-- | server/helpers/custom-validators/follows.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/follows.ts b/server/helpers/custom-validators/follows.ts new file mode 100644 index 000000000..fbef7ad87 --- /dev/null +++ b/server/helpers/custom-validators/follows.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { exists } from './misc' | ||
2 | import { FollowState } from '@shared/models' | ||
3 | |||
4 | function isFollowStateValid (value: FollowState) { | ||
5 | if (!exists(value)) return false | ||
6 | |||
7 | return value === 'pending' || value === 'accepted' | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | isFollowStateValid | ||
14 | } | ||