• Is organization exists validator

    Parameters

    • targetField: TargetField

      injected targetField use to get orgId

    • organizationAPI: OrganizationDefaultAdapterAPI

      injected API use to handle organization related operations

    • logger: Logger

      injected logger use to handle logging

    • context: AdapterHandlerContext

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

    Returns Promise<number>

    200 Status OK

    Description

    This validator checks if the organization exists by applying the following steps in sequence:

    1. Get orgId from targetField context

    2. Check if orgId is provided

    3. Check if organization exists

    Throws

    400 NBError Bad Request

    • orgId have to be specified in ${targetField.type} ${targetField.name}

    Throws

    404 NBError Not Found

    • orgId ${orgId} cannot be found

Generated using TypeDoc