diff --git a/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts b/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts index 054d672..f26bf35 100644 --- a/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts +++ b/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts @@ -1,9 +1,9 @@ import { Address } from "viem"; -import { ApplicationStatus, PoolType } from "@/components/Badges"; +import { PoolType } from "@/components/Badges"; import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; -import { ReviewBody } from "~checker/pages/SubmitFinalEvaluationPage"; +import { ReviewBody, ApplicationStatus } from "~checker/pages/SubmitFinalEvaluationPage"; import { generatePoolUUID } from "~checker/utils/generatePoolUUID"; import { categorizeProjectReviews } from "~checker/utils/mapApplicationsForOverviewPage"; @@ -26,7 +26,7 @@ export const useGetApplicationsFinalEvaluationPage = () => { applicationsToUpdate: [], currentApplications: Object.values(poolData.applications).map((app) => ({ index: Number(app.id), - status: app.status as ApplicationStatus, + status: app.status === "APPROVED" ? ApplicationStatus.APPROVED : ApplicationStatus.REJECTED, })), strategy: poolData.applications[0]?.round.strategyName === PoolType.QuadraticFunding ? 0 : 1, }; diff --git a/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx b/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx index 0e91493..e94b0ba 100644 --- a/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx +++ b/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx @@ -60,7 +60,13 @@ export const SubmitFinalEvaluationPage = ({ ); const handleRecordEvaluationsOnchain = () => { - setReviewBody(reviewBody ?? null); + setReviewBody({ + ...reviewBody, + applicationsToUpdate: Object.entries(projectEvaluations).map(([projectId, isApproved]) => ({ + index: Number(projectId), + status: isApproved ? "APPROVED" : "REJECTED", + })), + } as ReviewBody); setIsModalOpen(true); }; diff --git a/src/features/checker/pages/SubmitFinalEvaluationPage/types.ts b/src/features/checker/pages/SubmitFinalEvaluationPage/types.ts index 254ed52..98fb118 100644 --- a/src/features/checker/pages/SubmitFinalEvaluationPage/types.ts +++ b/src/features/checker/pages/SubmitFinalEvaluationPage/types.ts @@ -1,7 +1,13 @@ import { Address } from "viem"; -import { ApplicationStatus } from "@/components/Badges"; - +export enum ApplicationStatus { + PENDING = "PENDING", + APPROVED = "APPROVED", + REJECTED = "REJECTED", + APPEAL = "APPEAL", + IN_REVIEW = "IN_REVIEW", + CANCELLED = "CANCELLED", +} export enum RoundCategory { QuadraticFunding, Direct,