list of allowed types
which request field to check
request context [headers, body, params, query].
200 Status OK
This function is used to check if follower type is allowed or not by applying the following steps in sequence:
Get follower type from request context
If follower type is allowed return 200
If follower type is not allowed return 403
403 NBError Forbidden
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
Check follower type