aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers/user.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-27 22:52:19 +0300
committerGitHub <noreply@github.com>2023-09-27 22:52:19 +0300
commit1ef4498dadd8cdf7b60f4f256697d9329c9e9deb (patch)
treed70a1dd5bfff99a4add4aaa47bc584b3c2305131 /backend/handlers/user.go
parentfeat: detailed logging, db changes (#55) (diff)
downloadlphub-1ef4498dadd8cdf7b60f4f256697d9329c9e9deb.tar.gz
lphub-1ef4498dadd8cdf7b60f4f256697d9329c9e9deb.tar.bz2
lphub-1ef4498dadd8cdf7b60f4f256697d9329c9e9deb.zip
feat: revise logging in other handlers (#55)
Former-commit-id: ef5d934328d4389405cd51c08c2738093353a5cd
Diffstat (limited to 'backend/handlers/user.go')
-rw-r--r--backend/handlers/user.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/handlers/user.go b/backend/handlers/user.go
index 1b20af0..461e521 100644
--- a/backend/handlers/user.go
+++ b/backend/handlers/user.go
@@ -800,7 +800,7 @@ func UpdateUser(c *gin.Context) {
800 } 800 }
801 profile, err := GetPlayerSummaries(user.(models.User).SteamID, os.Getenv("API_KEY")) 801 profile, err := GetPlayerSummaries(user.(models.User).SteamID, os.Getenv("API_KEY"))
802 if err != nil { 802 if err != nil {
803 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateSummaryFail) 803 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateSummaryFail, err.Error())
804 c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) 804 c.JSON(http.StatusOK, models.ErrorResponse(err.Error()))
805 return 805 return
806 } 806 }
@@ -808,7 +808,7 @@ func UpdateUser(c *gin.Context) {
808 _, err = database.DB.Exec(`UPDATE users SET username = $1, avatar_link = $2, country_code = $3, updated_at = $4 808 _, err = database.DB.Exec(`UPDATE users SET username = $1, avatar_link = $2, country_code = $3, updated_at = $4
809 WHERE steam_id = $5`, profile.PersonaName, profile.AvatarFull, profile.LocCountryCode, time.Now().UTC(), user.(models.User).SteamID) 809 WHERE steam_id = $5`, profile.PersonaName, profile.AvatarFull, profile.LocCountryCode, time.Now().UTC(), user.(models.User).SteamID)
810 if err != nil { 810 if err != nil {
811 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateFail) 811 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateFail, "U#users: "+err.Error())
812 c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) 812 c.JSON(http.StatusOK, models.ErrorResponse(err.Error()))
813 return 813 return
814 } 814 }