From f7ab2719a2f5adc37bda26b60df2bb91103c388b Mon Sep 17 00:00:00 2001 From: maru Date: Fri, 19 Apr 2024 16:44:33 -0400 Subject: [PATCH] Don't make rankings endpoint update user activity --- api/daily/rankings.go | 7 +------ api/endpoints.go | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/api/daily/rankings.go b/api/daily/rankings.go index 2e5ba38..daaf7cf 100644 --- a/api/daily/rankings.go +++ b/api/daily/rankings.go @@ -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") diff --git a/api/endpoints.go b/api/endpoints.go index 396aab6..e4819b9 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -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") { @@ -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