Skip to content

Commit

Permalink
Merge pull request #225 from Aar-if/bugFixes
Browse files Browse the repository at this point in the history
Issue #PS-1774 feat: Course planner Taxonomy API integration in Facilitator App
  • Loading branch information
itsvick authored Sep 5, 2024
2 parents c95290a + 539f064 commit 5ac0192
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 171 deletions.
27 changes: 16 additions & 11 deletions src/pages/course-planner-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,22 @@ const CoursePlannerDetail = () => {
const [modalOpen, setModalOpen] = React.useState<boolean>(false);
const [courseDetails, setCourseDetails] = useState(null);
const [userProjectDetails, setUserProjectDetails] = useState([]);
const { subject } = router.query;
const { state } = router.query;
const { medium } = router.query;
const { grade } = router.query;
const { board } = router.query;

const fetchCourseDetails = useCallback(async () => {
try {
setLoading(true);
const response = await getTargetedSolutions({
subject: 'Tamil',
class: '4',
state: 'Maharashtra',
board: 'TQKR',
subject: subject ,
class: grade,
state: state,
board: board,
type: 'mainCourse',
medium: 'Telugu',
medium: medium,
});

const courseData = response.result.data[0];
Expand All @@ -79,7 +84,7 @@ const CoursePlannerDetail = () => {
console.error('Error fetching course planner:', error);
}
}, []);

const fetchCourseIdFromSolution = async (solutionId: string): Promise<string> => {
try {
const solutionResponse = await getSolutionDetails({
Expand All @@ -96,12 +101,12 @@ const CoursePlannerDetail = () => {
});

const updatedResponse = await getTargetedSolutions({
subject: 'Malayalam',
class: '5',
state: 'Maharashtra',
board: 'LPKR',
subject: subject,
class: grade,
state: state,
board: board,
type: 'mainCourse',
medium: 'Malayalam',
medium: medium,
});
setLoading(false);
return updatedResponse.result.data[0]._id;
Expand Down
Loading

0 comments on commit 5ac0192

Please sign in to comment.