From 46ce818fdec1dab1ce2900c3a1039660be8ebdad Mon Sep 17 00:00:00 2001 From: Viet Anh Nguyen Date: Tue, 12 Mar 2024 11:26:50 +0700 Subject: [PATCH] Correct field names --- cope2n-fe/src/pages/inference/index.tsx | 9 +++++---- cope2n-fe/src/pages/reviews/index.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cope2n-fe/src/pages/inference/index.tsx b/cope2n-fe/src/pages/inference/index.tsx index 8b96ece..45c5fcd 100644 --- a/cope2n-fe/src/pages/inference/index.tsx +++ b/cope2n-fe/src/pages/inference/index.tsx @@ -10,7 +10,6 @@ import { import styled from 'styled-components'; const { Sider, Content } = Layout; import { baseURL } from "request/api"; -import { useHotkeys } from "react-hotkeys-hook"; import { Viewer } from '@react-pdf-viewer/core'; import { SbtPageHeader } from 'components/page-header'; import { UploadOutlined } from '@ant-design/icons'; @@ -19,7 +18,7 @@ import 'react-json-view-lite/dist/index.css'; type FileType = Parameters>[0]; -const ENABLE_REVIEW = false; +const ENABLE_REVIEW = true; // Import the styles @@ -251,7 +250,9 @@ const InferencePage = () => { setResponseData(null); return; } - loadRequestById(data["request_id"]); + setTimeout(() => { + loadRequestById(data["request_id"]); + }, 2000); setFinishedProcessing(true); return data; }) @@ -298,7 +299,7 @@ const InferencePage = () => { const requestData = fetchRequest(requestID); requestData.then(async (data) => { if (data) setCurrentRequest(data); - const predicted = (data && data["Reviewed Result"]) ? data["Reviewed Result"] : {}; + const predicted = (data && data["Predicted Result"]) ? data["Predicted Result"] : {}; const revised = (data && data["Reviewed Result"]) ? data["Reviewed Result"] : {}; const keys = Object.keys(predicted); const tableRows = []; diff --git a/cope2n-fe/src/pages/reviews/index.tsx b/cope2n-fe/src/pages/reviews/index.tsx index f9f2d2a..5aa99a8 100644 --- a/cope2n-fe/src/pages/reviews/index.tsx +++ b/cope2n-fe/src/pages/reviews/index.tsx @@ -297,7 +297,7 @@ const ReviewPage = () => { const requestData = fetchRequest(data?.subscription_requests[0].RequestID); requestData.then(async (data) => { if (data) setCurrentRequest(data); - const predicted = (data && data["Reviewed Result"]) ? data["Reviewed Result"] : {}; + const predicted = (data && data["Predicted Result"]) ? data["Predicted Result"] : {}; const submitted = (data && data["Feedback Result"]) ? data["Feedback Result"] : {}; const revised = (data && data["Reviewed Result"]) ? data["Reviewed Result"] : {}; const keys = Object.keys(predicted);