Skip to content

Commit

Permalink
Adding the array in the post api.
Browse files Browse the repository at this point in the history
  • Loading branch information
amansharmma committed Sep 4, 2024
1 parent 8886d3f commit 6ff4af6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/PathwayCourse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function PathwayCourse() {
bgcolor: "background.paper",
outline: "none",
borderRadius: "8px",
boxShadow: 24,
box: 24,
p: 4,
};

Expand Down
20 changes: 11 additions & 9 deletions src/components/PathwayExercise/ExerciseContent/Assessment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,22 @@ function Assessment({
}
axios({
method: METHODS.POST,
// url: `${process.env.REACT_APP_MERAKI_URL}/assessment/student/result/v2`,
url: `${process.env.REACT_APP_MERAKI_URL}/assessment/slug/complete`,
headers: {
accept: "application/json",
Authorization:
user?.data?.token || localStorage.getItem("studentAuthToken"),
},
data: {
// assessment_id: exerciseId,
slug_id: exerciseSlugId,
selected_option: answer,
status: correctStr,
course_id: params.courseId,
lang: lang,
},
data: [
{
// assessment_id: exerciseId,
slug_id: exerciseSlugId,
selected_option: answer,
status: correctStr,
course_id: +params.courseId,
lang: lang,
},
],
})
.then((res) => {})
.catch((err) => {});
Expand All @@ -119,6 +120,7 @@ function Assessment({
setTriger(!triger);
};

console.log(data);
useEffect(() => {
// adding a nullish coalescing operator (??), so that the null value can not effect on the assessment.
// if (res?.assessment_id === (courseData ?? {}).id) {
Expand Down

0 comments on commit 6ff4af6

Please sign in to comment.