Skip to content

Commit

Permalink
Completely Finished!
Browse files Browse the repository at this point in the history
needs bug testing/fixes
  • Loading branch information
danknessdra committed Oct 15, 2022
1 parent 8e2ab06 commit 5ff48bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Form extends React.Component {
if (result===null) {
Swal.fire({
title: 'Invalid Input!',
text: 'Please ensure that your course or school is in the correct format.',
text: 'Please ensure that your course or school is in the correct format. If it is, contact @bobo#0007 on discord!',
showClass: {
popup: 'animate__animated animate__fadeInDown'
},
Expand Down Expand Up @@ -123,14 +123,14 @@ class Form extends React.Component {
}, "Select School"), /*#__PURE__*/React.createElement("option", {
value: "De Anza"
}, "De Anza"), /*#__PURE__*/React.createElement("option", {
value: "University Of California, Berkeley"
value: "UC Berkeley"
}, "UC Berkeley")), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("input", {
type: "subject",
name: "subject",
id: "subject",
value: this.state.course,
onChange: this.handleCourse,
placeholder: "Format: Course and ID I.E CS 46B",
placeholder: "Format: Course and ID I.E COMPSCI 61A",
required: true
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("input", {
type: "submit",
Expand Down
7 changes: 5 additions & 2 deletions rmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ func main() {
func getRank(writer http.ResponseWriter, request *http.Request, params httprouter.Params) {
var data InputCall
err := json.NewDecoder(request.Body).Decode(&data)
ranked := GetRanked(GetJson("./data/DeAnzaCourses.json"), data.Course)
if err != nil {
fmt.Println(err.Error())
return
}
ranked := GetRanked(GetJson("./data/courses.json"), data.Course)
if data.School == "UC Berkeley" {
ranked = GetRanked(GetJson("./data/BerkeleyCourses.json"), data.Course)
}
writer.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(writer).Encode(ranked)
}

func getCourses(writer http.ResponseWriter, request *http.Request, params httprouter.Params) {
ranked := GetJson("./data/courses.json")
ranked := GetJson("./data/DeAnzaCourses.json")
writer.Header().Set("Content-Type", "application/json")
writer.WriteHeader(http.StatusCreated)
_ = json.NewEncoder(writer).Encode(ranked)
Expand Down

0 comments on commit 5ff48bc

Please sign in to comment.