• create one organization review by user handler

    Parameters

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

      injected service use to handle the review related operations

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

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<adapter.AdapterHandlerResponse>

    201 Status Created

    Description

    This handler is used to create one organization review by user by applying the following steps in sequence:

    1. Get the orgId from params

    2. Create review where targetId is orgId (reviewService.createReview)

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

    4. Return the created review

    Throws

    400 NBError Bad Request

    • orgId is missing in request params

    Throws

    500 NBError Internal Server Error

    • create review failed

Generated using TypeDoc