• Get one product variant handler

    Parameters

    • 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
      • params.variantId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: product variant

    Description

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

    1. Get the variantId from params

    2. Get the productId from params

    3. Get the product variant (productVariantService.getProductVariant)

    4. Return the product variant

    Throws

    Error

    • productId is missing in params
    • variantId is missing in params

    Throws

    404 NBError Not Found

    • product ${productId}, variant ${variantId} not found

    Throws

    500 NBError Internal Server Error

    • Error happen when get product ${productId}, variant ${variantId} from database

Generated using TypeDoc