Skip to content

Commit

Permalink
Fixing discord command
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebRose committed Feb 9, 2024
1 parent d078862 commit ee68175
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controller/DiscordController.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func GetCollegePlayer(w http.ResponseWriter, r *http.Request) {
panic("User did not provide a first name")
}

player := managers.GetCollegePlayerByCollegePlayerId(id)
player := managers.GetCollegePlayerViaDiscord(id)

json.NewEncoder(w).Encode(player)
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func handleRequests() {
myRouter.HandleFunc("/ds/cfb/croot/{id}", controller.GetRecruitViaDiscord).Methods("GET")
myRouter.HandleFunc("/schedule/ds/current/week/{league}/", controller.GetCurrentWeekGamesByLeague).Methods("GET")
myRouter.HandleFunc("/ds/cfb/flex/{teamOneID}/{teamTwoID}/", controller.CompareTeams).Methods("GET")
myRouter.HandleFunc("/ds/cfb/conference/{conference}/", controller.CompareTeams).Methods("GET")
myRouter.HandleFunc("/ds/cfb/conference/{conference}/", controller.GetCollegeConferenceStandings).Methods("GET")
// Easter Controls
myRouter.HandleFunc("/easter/egg/collude/", controller.CollusionButton).Methods("POST")

Expand Down
4 changes: 2 additions & 2 deletions managers/PlayerManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func GetCollegePlayerByCollegePlayerId(CollegePlayerId string) structs.CollegePl
return CollegePlayer
}

func GetCollegePlayerByNameAndTeam(firstName string, lastName string, teamID string) models.CollegePlayerCSV {
func GetCollegePlayerViaDiscord(id string) models.CollegePlayerCSV {
db := dbprovider.GetInstance().GetDB()

var CollegePlayer structs.CollegePlayer

db.Where("first_name = ? and last_name = ? and team_id = ?", firstName, lastName, teamID).Find(&CollegePlayer)
db.Where("id = ?", id).Find(&CollegePlayer)

collegePlayerResponse := models.MapPlayerToCSVModel(CollegePlayer)

Expand Down

0 comments on commit ee68175

Please sign in to comment.