• Check follow exist

    Parameters

    Returns Promise<number>

    200 Status OK

    Description

    This function is used to check if follow exist by applying the following steps in sequence:

    1. Get followId and followerId from request context

    2. Get follow by followId and followerId (followerService.getOneFollow)

    3. If follow not exist return 200

    4. If follow exist return 403

    Throws

    403 NBError Forbidden

    • follow exist

    Example: example usage

    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