pweb-api-ets / controller /user /user_update_profile_controller.go
lifedebugger's picture
Deploy files from GitHub repository
131eba4
raw
history blame contribute delete
788 Bytes
package user
import (
"github.com/gin-gonic/gin"
"pweb-api.abdanhafidz.com/controller"
"pweb-api.abdanhafidz.com/models"
"pweb-api.abdanhafidz.com/services"
)
func UpdateProfile(c *gin.Context) {
userProfile := services.UserProfileService{}
userUpdateProfileController := controller.Controller[models.AccountDetails, models.AccountDetails, models.UserProfileResponse]{
Service: &userProfile.Service,
}
userUpdateProfileController.RequestJSON(c, func() {
userUpdateProfileController.Service.Constructor = userUpdateProfileController.Request
userUpdateProfileController.HeaderParse(c, func() {
userUpdateProfileController.Service.Constructor.AccountId = uint(userUpdateProfileController.AccountData.UserID)
})
userProfile.Update()
},
)
}