aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers/user.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-11-06 08:37:57 +0300
committerGitHub <noreply@github.com>2023-11-06 08:37:57 +0300
commit1ea886701bc3f945a520d4e01194109cad83ebbc (patch)
tree59add9c86d713bf7683e0dd32b7fa0a579c39609 /backend/handlers/user.go
parentfeat: profile (#54) (diff)
downloadlphub-1ea886701bc3f945a520d4e01194109cad83ebbc.tar.gz
lphub-1ea886701bc3f945a520d4e01194109cad83ebbc.tar.bz2
lphub-1ea886701bc3f945a520d4e01194109cad83ebbc.zip
fix: sql typo in update user (#127)
Former-commit-id: dd0f8d101c7bb7e8817ed0e4e284a88674209e14
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 e975d07..d550862 100644
--- a/backend/handlers/user.go
+++ b/backend/handlers/user.go
@@ -806,8 +806,8 @@ func UpdateUser(c *gin.Context) {
806 return 806 return
807 } 807 }
808 // Update profile 808 // Update profile
809 _, err = database.DB.Exec(`UPDATE users SET username = $1, avatar_link = $2, country_code = $3, updated_at = $4 809 sql := `UPDATE users SET user_name = $1, avatar_link = $2, country_code = $3, updated_at = $4 WHERE steam_id = $5`
810 WHERE steam_id = $5`, profile.PersonaName, profile.AvatarFull, profile.LocCountryCode, time.Now().UTC(), user.(models.User).SteamID) 810 _, err = database.DB.Exec(sql, profile.PersonaName, profile.AvatarFull, profile.LocCountryCode, time.Now().UTC(), user.(models.User).SteamID)
811 if err != nil { 811 if err != nil {
812 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateFail, "UPDATE#users: "+err.Error()) 812 CreateLog(user.(models.User).SteamID, LogTypeUser, LogDescriptionUserUpdateFail, "UPDATE#users: "+err.Error())
813 c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) 813 c.JSON(http.StatusOK, models.ErrorResponse(err.Error()))