From 6be155bc961b9bcf599c46ecc9f536c73b85d7e8 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sat, 16 Oct 2021 01:47:50 +0200 Subject: [PATCH] fixed vac date displaying without being set --- main.go | 4 ++-- utils/utils.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 77db50f..51078d6 100644 --- a/main.go +++ b/main.go @@ -144,7 +144,7 @@ func getPlayer(w http.ResponseWriter, r *http.Request) { } if !tPlayer.VacDate.IsZero() { - response.VACDate = tPlayer.VacDate + response.VACDate = &tPlayer.VacDate } db.Lock.RLock() @@ -508,7 +508,7 @@ func getMatch(w http.ResponseWriter, r *http.Request) { if !iStats.Edges.Players.VacDate.IsZero() { switch s := sResponse.Player.(type) { case utils.PlayerResponse: - s.VACDate = iStats.Edges.Players.VacDate + s.VACDate = &iStats.Edges.Players.VacDate } } diff --git a/utils/utils.go b/utils/utils.go index ffcd37e..b610097 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -155,7 +155,7 @@ type PlayerResponse struct { Name string `json:"name"` Avatar string `json:"avatar"` VAC bool `json:"vac"` - VACDate time.Time `json:"vac_date,omitempty"` + VACDate *time.Time `json:"vac_date,omitempty"` Tracked bool `json:"tracked"` VanityURL string `json:"vanity_url,omitempty"` MatchStats MatchStats `json:"match_stats,omitempty"`