aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/handlers/user.go')
-rw-r--r--backend/handlers/user.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/backend/handlers/user.go b/backend/handlers/user.go
index 2df2040..f04145e 100644
--- a/backend/handlers/user.go
+++ b/backend/handlers/user.go
@@ -63,8 +63,6 @@ type ScoreResponse struct {
63// @Produce json 63// @Produce json
64// @Param Authorization header string true "JWT Token" 64// @Param Authorization header string true "JWT Token"
65// @Success 200 {object} models.Response{data=ProfileResponse} 65// @Success 200 {object} models.Response{data=ProfileResponse}
66// @Failure 400 {object} models.Response
67// @Failure 401 {object} models.Response
68// @Router /profile [get] 66// @Router /profile [get]
69func Profile(c *gin.Context) { 67func Profile(c *gin.Context) {
70 // Check if user exists 68 // Check if user exists
@@ -343,13 +341,11 @@ func Profile(c *gin.Context) {
343// @Tags users 341// @Tags users
344// @Accept json 342// @Accept json
345// @Produce json 343// @Produce json
346// @Param id path int true "User ID" 344// @Param userid path int true "User ID"
347// @Success 200 {object} models.Response{data=ProfileResponse} 345// @Success 200 {object} models.Response{data=ProfileResponse}
348// @Failure 400 {object} models.Response 346// @Router /users/{userid} [get]
349// @Failure 404 {object} models.Response
350// @Router /users/{id} [get]
351func FetchUser(c *gin.Context) { 347func FetchUser(c *gin.Context) {
352 id := c.Param("id") 348 id := c.Param("userid")
353 // Check if id is all numbers and 17 length 349 // Check if id is all numbers and 17 length
354 match, _ := regexp.MatchString("^[0-9]{17}$", id) 350 match, _ := regexp.MatchString("^[0-9]{17}$", id)
355 if !match { 351 if !match {
@@ -634,8 +630,6 @@ func FetchUser(c *gin.Context) {
634// @Produce json 630// @Produce json
635// @Param Authorization header string true "JWT Token" 631// @Param Authorization header string true "JWT Token"
636// @Success 200 {object} models.Response{data=ProfileResponse} 632// @Success 200 {object} models.Response{data=ProfileResponse}
637// @Failure 400 {object} models.Response
638// @Failure 401 {object} models.Response
639// @Router /profile [post] 633// @Router /profile [post]
640func UpdateUser(c *gin.Context) { 634func UpdateUser(c *gin.Context) {
641 // Check if user exists 635 // Check if user exists
@@ -681,8 +675,6 @@ func UpdateUser(c *gin.Context) {
681// @Param Authorization header string true "JWT Token" 675// @Param Authorization header string true "JWT Token"
682// @Param country_code query string true "Country Code [XX]" 676// @Param country_code query string true "Country Code [XX]"
683// @Success 200 {object} models.Response 677// @Success 200 {object} models.Response
684// @Failure 400 {object} models.Response
685// @Failure 401 {object} models.Response
686// @Router /profile [put] 678// @Router /profile [put]
687func UpdateCountryCode(c *gin.Context) { 679func UpdateCountryCode(c *gin.Context) {
688 // Check if user exists 680 // Check if user exists