• Update Attribute Handler

    Parameters

    • attributeService: Pick<AttributeDataService, "getAttribute" | "normalizeAttributeResponse" | "updateAttribute">

      injected service use to handle the attribute related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params.attributeId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: updated attribute

    Description

    This handler is used to update an attribute by applying the following steps in sequence:

    1. Get the attributeId from params

    2. Update the attribute (attributeService.updateAttribute)

    3. Get the updated attribute (attributeService.getOneAttribute)

    4. Return the updated attribute

    Throws

    Error

    • attributeId is missing from path

    Throws

    500 NBError Internal Server Error

    • update attribute failed

Generated using TypeDoc