diff options
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 | } | ||