• Update location handler

    Parameters

    • locationService: Pick<LocationDataService, "getLocation" | "normalizeLocationResponse" | "updateLocation">

      injected service use to handle the location related operations

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params.id is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status Ok

    • data: updated location

    Description

    This handler is used to update a location by applying the following steps in sequence:

    1. Get the locationId from params

    2. Update the location (locationService.updateLocation)

    3. Get the updated location (locationService.getLocation)

    4. Return the updated location (locationService.normalizeLocationResponse)

    Throws

    Error

    • id is missing from path

    Throws

    404 NBError Not Found

    • Location ${id} not found

    Throws

    500 NBError Internal Server Error

    • Error happen when update location ${id} from database

Generated using TypeDoc