• Does location exist validator

    Parameters

    • locationIdFieldInfo: TargetField

      which field to get the locationId from context

    • locationService: LocationDataService

      location service

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<number>

    200 Status Ok

    Description

    This validator is used to check if the location exists by applying the following steps in sequence:

    1. Get the locationId from the context

    2. Check if the locationId is null

    3. Check if the location is exist

    Throws

    400 NBError Wrong parameter

    • locationId is missing in locationIdFieldInfo.type, locationIdFieldInfo.name

    Throws

    404 NBError Not found

    • location not found: locationId

Generated using TypeDoc