Skip to content

Commit

Permalink
fix(notif handler): update to fit new api
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Apr 5, 2023
1 parent c61e5a0 commit f5db508
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/middleware/notificationOnEditHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SitesService from "@root/services/identity/SitesService"
import ReviewRequestService from "@root/services/review/ReviewRequestService"
import { RequestHandler } from "@root/types"

// eslint-disable-next-line import/prefer-default-export
export class NotificationOnEditHandler {
private readonly reviewRequestService: ReviewRequestService

Expand Down Expand Up @@ -53,10 +54,10 @@ export class NotificationOnEditHandler {
const { siteName, isomerUserId: userId, email } = userWithSiteSessionData
const site = await this.sitesService.getBySiteName(siteName)
const users = await this.collaboratorsService.list(siteName, userId)
if (!site) throw new Error("Site should always exist")
if (site.isErr()) throw new Error("Site should always exist")
const reviewRequests = await this.reviewRequestService.listReviewRequest(
userWithSiteSessionData,
site
site.value
)
if (reviewRequests.length === 0) return
// For now, we only have 1 active review request
Expand Down

0 comments on commit f5db508

Please sign in to comment.