From d0217176c370047ed3d3e4ccd68f5d5e62d0fa5e Mon Sep 17 00:00:00 2001 From: Rushikesh-Sonawane99 Date: Wed, 27 Nov 2024 18:20:25 +0530 Subject: [PATCH] Issue #PS-2649 chore: Replaced assessment api with knowledge apis --- app.config.ts | 6 +++--- src/components/AssessmentReport.tsx | 2 +- src/components/AssessmentReportCard.tsx | 6 +++++- src/pages/learner/[userId].tsx | 2 +- src/services/AssesmentService.ts | 12 +++++++----- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app.config.ts b/app.config.ts index 274420e1..abd6535a 100644 --- a/app.config.ts +++ b/app.config.ts @@ -69,7 +69,7 @@ export const DaysOfWeek = { Sat: 6, }; -export const Program = 'Second chance'; +export const Program = 'secondchance'; export const tenantId = process.env.NEXT_PUBLIC_TENANT_ID || ''; if (!tenantId) { @@ -86,8 +86,8 @@ if (!frameworkId) { } export enum AssessmentType { - PRE_TEST = 'Pre Test', - POST_TEST = 'Post Test', + PRE_TEST = 'pre-test', + POST_TEST = 'post-test', } export const RequisiteType = { diff --git a/src/components/AssessmentReport.tsx b/src/components/AssessmentReport.tsx index 531111b5..f9928c9b 100644 --- a/src/components/AssessmentReport.tsx +++ b/src/components/AssessmentReport.tsx @@ -38,7 +38,7 @@ const AssessmentReport: React.FC = ({ const filters = { program: [Program], se_boards: [stateName], - assessment1: type, + assessmentType: type, }; try { diff --git a/src/components/AssessmentReportCard.tsx b/src/components/AssessmentReportCard.tsx index 48dc81cf..f8f154ff 100644 --- a/src/components/AssessmentReportCard.tsx +++ b/src/components/AssessmentReportCard.tsx @@ -140,7 +140,11 @@ const AssessmentReportCard: React.FC = ({ fontWeight: '400', }} > - {cardTitle} + {cardTitle === 'pre-test' + ? t('PROFILE.PRE_TEST') + : cardTitle === 'post-test' + ? t('PROFILE.POST_TEST') + : cardTitle} = ({ }} > - + diff --git a/src/services/AssesmentService.ts b/src/services/AssesmentService.ts index 80cfca42..a55933d2 100644 --- a/src/services/AssesmentService.ts +++ b/src/services/AssesmentService.ts @@ -26,16 +26,18 @@ export const getAssessmentList = async ({ export const getDoIdForAssessmentDetails = async ({ filters, }: GetDoIdServiceParam): Promise => { - // const apiUrl: string = `${URL_CONFIG.API.COMPOSITE_SEARCH}`; - const apiUrl: string = - 'https://sunbirdsaas.com/api/content/v1/search?orgdetails=orgName%2Cemail&licenseDetails=name%2Cdescription%2Curl'; + const apiUrl: string = `${URL_CONFIG.API.COMPOSITE_SEARCH}`; + // const apiUrl: string = + // 'https://sunbirdsaas.com/api/content/v1/search?orgdetails=orgName%2Cemail&licenseDetails=name%2Cdescription%2Curl'; const data = { request: { filters: { program: filters.program, - se_boards: filters.se_boards, + board: filters.se_boards, // subject: filters.subject, - assessment1: filters.assessment1, + assessmentType: filters.assessment1, + status: ['Live'], + primaryCategory: ['Practice Question Set'], }, }, };