in edu-analytics-be/web/app/entity/educatorEntity.js [312:330]
static async enrollStudentToCourse(token, body) {
try {
const result = await axios({
method: "POST",
headers: { Authorization: `Bearer ${token}` },
url: `https://classroom.googleapis.com/v1/courses/${body.courseId}/students`,
data: {
userId: body.studentId,
courseId: body.courseId,
}
})
return result.data;
} catch (error) {
console.log(error);
return error.response.status;
//res.send(error).status(400);
}
}