feat: complete profile update and settings management

refactor: change profile update endpoints to PUT
refactor: changed profile settings update query to use username
chore: update SQL queries for profile operations
This commit is contained in:
2025-07-23 17:46:59 +03:00
parent f38af13dc1
commit d14f90d628
7 changed files with 130 additions and 38 deletions

View File

@@ -65,14 +65,14 @@ func NewProfileController(_log *zap.Logger, _ps services.ProfileService) Control
Function: ctrl.getProfileSettings,
},
{
HttpMethod: PATCH,
HttpMethod: PUT,
Path: "",
Authorization: enums.UserRole,
Middleware: []gin.HandlerFunc{},
Function: ctrl.updateProfile,
},
{
HttpMethod: PATCH,
HttpMethod: PUT,
Path: "/settings",
Authorization: enums.UserRole,
Middleware: []gin.HandlerFunc{},
@@ -171,7 +171,7 @@ func (ctrl *ProfileController) getProfileSettings(c *gin.Context) {
// @Security JWT
// @Param request body dto.ProfileDto true " "
// @Success 200 {object} bool " "
// @Router /profile [patch]
// @Router /profile [put]
func (ctrl *ProfileController) updateProfile(c *gin.Context) {
request, err := GetRequest[dto.ProfileDto](c); if err != nil {
return
@@ -193,7 +193,7 @@ func (ctrl *ProfileController) updateProfile(c *gin.Context) {
// @Security JWT
// @Param request body dto.ProfileSettingsDto true " "
// @Success 200 {object} bool " "
// @Router /profile/settings [patch]
// @Router /profile/settings [put]
func (ctrl *ProfileController) updateProfileSettings(c *gin.Context) {
request, err := GetRequest[dto.ProfileSettingsDto](c); if err != nil {
return