• Is not last owner validator

    Parameters

    • lastOwnerChecker: ((orgId, userId) => Promise<boolean>)

      injected function use to check if the user is the last owner

        • (orgId, userId): Promise<boolean>
        • Parameters

          • orgId: string
          • userId: string

          Returns Promise<boolean>

    • 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 will check if the user is not the last owner by applying the following steps in sequence:

    1. Get orgId and userId from context

    2. Check if orgId and userId exist

    3. Check if the user is not the last owner

    Throws

    400 NBError Bad Request

    • missing orgId or userId in params

    Throws

    403 NBError Forbidden

    • user ${params?.userId} is organization ${params?.orgId}'s last owner

Generated using TypeDoc