• Create Category Handler

    Parameters

    • categoryService: Pick<CategoryDataService, "createCategory" | "getCategory" | "normalizeCategoryResponse">

      injected service use to handle the category related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<adapter.AdapterHandlerResponse>

    201 Status Created

    • data: category

    Description

    This handler is used to create a category by applying the following steps in sequence:

    1. Create the category (categoryService.createCategory)

    2. Get the category (categoryService.getOneCategory)

    3. Return the category (categoryService.normalizeCategoryResponse)

    Throws

    500 NBError Internal Server Error

    • create category failed

Generated using TypeDoc