• Check follower type

    Parameters

    Returns Promise<number>

    200 Status OK

    Description

    This function is used to check if follower type is allowed or not by applying the following steps in sequence:

    1. Get follower type from request context

    2. If follower type is allowed return 200

    3. If follower type is not allowed return 403

    Throws

    403 NBError Forbidden

    • follower type is not allow

    Example: example usage

    const types = ['user', 'product'];
    const targetField = {
    type: 'body',
    name: 'followerType',
    };
    const logger = new Logger();
    const context = {
    body: {
    followerType: 'user',
    },
    };

    const result = await checkFollowerType(types, targetField, logger, context); // Return 200

Generated using TypeDoc