• Update user review by org handler

    Parameters

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

      injected service use to handle the review related operations

      • updateReview
    • userApi: Pick<UserDefaultAdapterAPI, "updateUserReviewStats">
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<adapter.AdapterHandlerResponse>

    200 Status OK

    Description

    This handler is used to update user review by org by applying the following steps in sequence:

    1. Get the reviewId from params

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

    3. Recalculate user stats (userApi.updateUserReviewStats) 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