You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constsubjectNumber=prompt("What is the number of the class you want to add? (8.02, 18.01, etc.)");
90
+
if(!subjectNumber){
91
+
return;
92
+
}
93
+
94
+
this.setState({
95
+
loading: true,
96
+
error: ""
97
+
},()=>{
98
+
api.post("schools/settings/callMethod",{
99
+
school: "mit",
100
+
methodName: "addCustomClass",
101
+
methodParams: JSON.stringify({
102
+
subjectNumber: subjectNumber
103
+
})
104
+
},(data)=>{
105
+
if(data.status=="ok"){
106
+
this.props.loadDetails(()=>{
107
+
this.setState({
108
+
loading: false
109
+
});
110
+
});
111
+
}elseif(data.error=="invalid_params"){
112
+
this.setState({
113
+
loading: false,
114
+
error: "We couldn't find the class with that subject number. Make sure it's spelled as it appears in the Course Catalog.\n\nFor help, email [email protected]."
115
+
});
116
+
}elseif(data.error=="already_enrolled"){
117
+
this.setState({
118
+
loading: false,
119
+
error: "You already have that class in your registration."
0 commit comments