• Update one product handler

    Parameters

    • productService: ProductDataService

      injected service use to handle the catalog related operations

    • productVariantService: ProductVariantDataService

      injected service use to handle the catalog related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params.productId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: updated product

    Description

    This handler is used to update one product by applying the following steps in sequence:

    1. Get the productId from params

    2. Update the product (productService.updateProduct)

    3. Get the updated product (productService.getProduct)

    4. Return the updated product

    Throws

    Error

    • productId is missing from path

    Throws

    404 NBError Not Found

    • product with id: ${productId} not found

    Throws

    500 NBError Internal Server Error

    • Error happen when update product ${productId} from database

Generated using TypeDoc