• Check if ownerId to create Organization exists as a user

    Parameters

    • userAPI: Pick<UserDefaultAdapterAPI, "getUserById">

      injected api use to handle the user related operations

    • ownerIdTargetField: TargetField

      the ownerId target field

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<util.StatusCodes>

    200 Status OK

    Description

    This validator will check if the ownerId used is an existing user by applying the following steps in sequence:

    1. Get user by ownerId in body context

    2. If ownerId was not passed, return OK

    3. Check user API if user exists

    Throws

    400 NBError Bad Request

    • OwnerId of organization does not exist as a user

Generated using TypeDoc