From b8f4167fb6fa448125aeecff80b201d74e27fe6a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 28 Nov 2019 11:37:32 +0100 Subject: Only display accepted followers/followings in about page --- server/helpers/custom-validators/follows.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/helpers/custom-validators/follows.ts (limited to 'server/helpers/custom-validators/follows.ts') 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 @@ +import { exists } from './misc' +import { FollowState } from '@shared/models' + +function isFollowStateValid (value: FollowState) { + if (!exists(value)) return false + + return value === 'pending' || value === 'accepted' +} + +// --------------------------------------------------------------------------- + +export { + isFollowStateValid +} -- cgit v1.2.3