Skip to content

Commit

Permalink
chore(routes/review): updaterr api
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Oct 21, 2022
1 parent 2c86357 commit 75c0743
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/routes/v2/authenticated/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import CollaboratorsService from "@root/services/identity/CollaboratorsService"
import SitesService from "@root/services/identity/SitesService"
import UsersService from "@root/services/identity/UsersService"
import { isIsomerError, RequestHandler } from "@root/types"
import { ResponseErrorBody } from "@root/types/dto /error"
import { ResponseErrorBody } from "@root/types/dto/error"
import {
DashboardReviewRequestDto,
EditedItemDto,
RequestChangeDto,
UpdateReviewRequestDto,
ReviewRequestDto,
} from "@root/types/dto /review"
} from "@root/types/dto/review"
import ReviewRequestService from "@services/review/ReviewRequestService"
// eslint-disable-next-line import/prefer-default-export
export class ReviewsRouter {
Expand Down Expand Up @@ -333,7 +333,7 @@ export class ReviewsRouter {
updateReviewRequest: RequestHandler<
{ siteName: string; requestId: number },
ResponseErrorBody,
RequestChangeDto,
UpdateReviewRequestDto,
unknown,
{ userWithSiteSessionData: UserWithSiteSessionData }
> = async (req, res) => {
Expand Down Expand Up @@ -397,7 +397,7 @@ export class ReviewsRouter {
}

// Step 4: Check that all new reviewers are admins of the site
const { reviewers, title, description } = req.body
const { reviewers } = req.body
const collaborators = await this.collaboratorsService.list(siteName)
const collaboratorMappings = Object.fromEntries(
reviewers.map((reviewer) => [reviewer, true])
Expand All @@ -420,14 +420,11 @@ export class ReviewsRouter {
}

// Step 5: Update the rr with the appropriate details
return this.reviewRequestService.updateReviewRequest(
possibleReviewRequest,
{
title,
description,
reviewers: verifiedReviewers,
}
)
await this.reviewRequestService.updateReviewRequest(possibleReviewRequest, {
reviewers: verifiedReviewers,
})

return res.status(200).send()
}

mergeReviewRequest: RequestHandler<
Expand Down

0 comments on commit 75c0743

Please sign in to comment.