• Is review exists validator

    Parameters

    • reviewIdFieldInfo: TargetField

      review field info to get the review id

    • reviewService: ReviewDataService

      injected service use to handle the review related operations

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

    1. Get the reviewId from context

    2. Get the review by reviewId (reviewService.getOneReviewById)

    3. Return the status code

    Throws

    400 NBError Bad Request

    • reviewId is missing in ${reviewIdFieldInfo.type}, ${reviewIdFieldInfo.name}

    Throws

    404 NBError Not Found

    • review for id ${reviewId} is not exists

Generated using TypeDoc