Skip to content

Commit

Permalink
updates reviewBody
Browse files Browse the repository at this point in the history
  • Loading branch information
nijoe1 committed Nov 28, 2024
1 parent 8d907fe commit 8079969
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
10 changes: 8 additions & 2 deletions src/features/checker/pages/SubmitFinalEvaluationPage/types.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 8079969

Please sign in to comment.