Skip to content

Commit

Permalink
Merge pull request #628 from Aar-if/subzero
Browse files Browse the repository at this point in the history
Issue #PS-0000 feat: Taxonomy changes Retention
  • Loading branch information
itsvick authored Jan 21, 2025
2 parents 703db9f + d629066 commit 8566fa2
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/pages/curriculum-planner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,29 @@ const CoursePlanner = () => {

if (medium && grade && board) {
console.log(medium, grade, board);
const getBoards = getOptionsByCategory(framework, 'board');
const url = `/api/framework/v1/read/${frameworkId}`;

// Use axios to fetch data from the API
const response = await axios.get(url);
const boardData = response.data;

const frameworks = boardData?.result?.framework;

const getBoards = await getOptionsByCategory(frameworks, 'board');
console.log(getBoards);
const matchBoard = getBoards.find((item: any) => item.name === board);
const matchBoard = getBoards?.find(
(item: any) => item.name === board
);
console.log(matchBoard);
const getMedium = getOptionsByCategory(framework, 'medium');
const getMedium = getOptionsByCategory(frameworks, 'medium');
const matchMedium = getMedium.find(
(item: any) => item.name === medium
);
console.log(matchMedium);
const getGrades = getOptionsByCategory(framework, 'gradeLevel');
const getGrades = getOptionsByCategory(frameworks, 'gradeLevel');
const matchGrade = getGrades.find((item: any) => item.name === grade);
console.log(matchGrade);
const getCourseTypes = getOptionsByCategory(framework, 'courseType');
const getCourseTypes = getOptionsByCategory(frameworks, 'courseType');
const courseTypes = getCourseTypes?.map((type: any) => type.name);
setTypeOptions(courseTypes);
console.log(courseTypes);
Expand Down Expand Up @@ -294,7 +304,7 @@ const CoursePlanner = () => {
}
};
fetchTaxonomyResults();
}, [value, selectedValue]);
}, [value, selectedValue, classId]);

const handleChange = (event: SelectChangeEvent<string>) => {
const newValue = event.target.value as string;
Expand Down

0 comments on commit 8566fa2

Please sign in to comment.