• Is user exists validator

    Parameters

    • targetField: TargetField

      target field to get the user id

    • userService: UserDefaultAdapterAPI

      injected api use to handle the user related operations

      • getUserById
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<number>

    200 Status OK

    Description

    This validator is used to check if the user is exists by applying the following steps in sequence:

    1. Get the userId from context

    2. Get the user by userId (userAPI.getUserById)

    3. Return the status code

    Throws

    404 NBError Not Found

    • user is not exists

Generated using TypeDoc