• Get user follows handler

    Parameters

    • paginationConfiguration: PaginationConfigurations

      injected configurations

      • defaultPageSize
      • defaultOffset
      • maxPageSize
    • productService: ProductDataService

      injected service use to handle the catalog related operations

    • followerService: FollowerService

      injected service use to handle the follower related operations

      • findWithPagination
    • userId: string

      injected userId

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: user product follows

    Description

    This handler is used to get a list of user follows by applying the following steps in sequence:

    1. Parse the query to get the pagination options (util.parsePaginatedListQuery)

    2. Check if the pagination options are valid

    3. Get the user follows (followerService.findWithPagination)

    4. Get the user product follows (productService.getUserProductFollows)

    5. Return the user product follows

    Throws

    400 NBError Bad Request

    • error when parse paginated list query, ${error.message}
    • pagination must be set
    • Page size exceeds ${configurations.maxPageSize} mbs

    Throws

    500 NBError Internal Server Error

    • error getting user follow list

Generated using TypeDoc