diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-22 23:58:26 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-22 23:58:26 +0300 |
| commit | 9cd44de9be62e1291f84763bc029f995301e1e03 (patch) | |
| tree | 5b4b8bc6d7a89173373fbb32c5a8c5013f8c9d82 /backend/handlers/user.go | |
| parent | feat: map search (#78) (diff) | |
| download | lphub-9cd44de9be62e1291f84763bc029f995301e1e03.tar.gz lphub-9cd44de9be62e1291f84763bc029f995301e1e03.tar.bz2 lphub-9cd44de9be62e1291f84763bc029f995301e1e03.zip | |
feat: discussions (#59)
Former-commit-id: ac6ac59367650b6a37650f5aec0587c6ce4d3dd1
Diffstat (limited to 'backend/handlers/user.go')
| -rw-r--r-- | backend/handlers/user.go | 16 |
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] |
| 69 | func Profile(c *gin.Context) { | 67 | func 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] | ||
| 351 | func FetchUser(c *gin.Context) { | 347 | func 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] |
| 640 | func UpdateUser(c *gin.Context) { | 634 | func 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] |
| 687 | func UpdateCountryCode(c *gin.Context) { | 679 | func UpdateCountryCode(c *gin.Context) { |
| 688 | // Check if user exists | 680 | // Check if user exists |