• Update organization reviews handler

    Parameters

    • reviewService: Pick<ReviewDataService, "calculateStatisticsForTarget" | "updateReview" | "getOneReviewById">

      injected service use to handle the review related operations

      • updateReview
    • organizationApi: Pick<OrganizationDefaultAdapterAPI, "updateOrganizationReviewStats">
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params.reviewId is required

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status OK

    Description

    This handler is used to update organization reviews by applying the following steps in sequence:

    1. Get the reviewId from params

    2. Update review where reviewId is reviewId (reviewService.updateReview)

    3. Recalculate organization stats (organizationApi.updateOrganizationReviewStats) If an error occurs, it is logged and the process continues

    4. Return success

    Throws

    400 NBError Bad Request

    • reviewId is missing in request params

    Throws

    500 NBError Internal Server Error

    • update review failed

Generated using TypeDoc