Skip to content

Commit

Permalink
Don't make rankings endpoint update user activity
Browse files Browse the repository at this point in the history
  • Loading branch information
patapancakes committed Apr 19, 2024
1 parent 1d54c1a commit f7ab271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
7 changes: 1 addition & 6 deletions api/daily/rankings.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import (
)

// /daily/rankings - fetch daily rankings
func Rankings(uuid []byte, category, page int) ([]defs.DailyRanking, error) {
err := db.UpdateAccountLastActivity(uuid)
if err != nil {
log.Print("failed to update account last activity")
}

func Rankings(category, page int) ([]defs.DailyRanking, error) {
rankings, err := db.FetchRankings(category, page)
if err != nil {
log.Print("failed to retrieve rankings")
Expand Down
8 changes: 2 additions & 6 deletions api/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case "/daily/seed":
w.Write([]byte(daily.Seed()))
case "/daily/rankings":
uuid, err := getUUIDFromRequest(r)
if err != nil {
httpError(w, r, err, http.StatusBadRequest)
return
}
var err error

var category int
if r.URL.Query().Has("category") {
Expand All @@ -242,7 +238,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}

rankings, err := daily.Rankings(uuid, category, page)
rankings, err := daily.Rankings(category, page)
if err != nil {
httpError(w, r, err, http.StatusInternalServerError)
return
Expand Down

0 comments on commit f7ab271

Please sign in to comment.