• Get category list handler

    Parameters

    • categoryService: Pick<CategoryDataService, "listPaginatedCategories" | "normalizeCategoryResponses">

      injected service use to handle the category related operations

    • paginationConfiguration: PaginationConfigurations

      injected pagination configuration

    • 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: category list

    Description

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

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

    2. Get the category list (categoryService.listPaginatedCategories)

    3. Return the category list (categoryService.normalizeCategoryResponses)

    Throws

    400 NBError Bad Request

    • error when parse paginated list query, ${error.message}

    Throws

    400 NBError Bad Request

    • pagination must be set

    Throws

    400 NBError Bad Request

    • Page size exceeds ${MAXIMUM_PAGE_SIZE} mbs

    Throws

    500 NBError Internal Server Error

    • Error happen when get category list from database

Generated using TypeDoc