• Is organization exists validator

    Parameters

    • targetField: TargetField

      target field to get the org id

    • organizationAPI: OrganizationDefaultAdapterAPI

      injected api use to handle the organization related operations

      • getOrganizationById
    • 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 organization is exists by applying the following steps in sequence:

    1. Get the orgId from context

    2. Get the organization by orgId (organizationAPI.getOrganizationById)

    3. Return the status code

    Throws

    400 NBError Bad Request

    • cannot found parameter in ${targetField.type} ${targetField.name}

    Throws

    404 NBError Not Found

    • organization is not exists

Generated using TypeDoc