Follower service
Which request field to check
unique identifier of the entity that has been followed
unique identifier of the entity of the follower
request context [headers, body, params, query].
200 Status OK
This function is used to check if follow exist by applying the following steps in sequence:
Get followId and followerId from request context
Get follow by followId and followerId (followerService.getOneFollow)
If follow not exist return 200
If follow exist return 403
403 NBError Forbidden
const followerService = new FollowerService();
const targetField = {
followId: {
type: 'params',
name: 'userId',
},
followerId: {
type: 'body',
name: 'followerId',
},
};
const logger = new Logger();
const context = {
params: {
userId: '1',
},
body: {
followerId: '2',
},
};
const result = await isFollowExist(followerService, targetField, logger, context); // Return 200
Generated using TypeDoc
Check follow exist