File size: 751 Bytes
34fb971
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package user

import (
	"api.qobiltu.id/controller"
	"api.qobiltu.id/models"
	"api.qobiltu.id/services"
	"github.com/gin-gonic/gin"
)

func UpdateProfile(c *gin.Context) {
	userProfile := services.UserProfileService{}
	userUpdateProfileController := controller.Controller[models.AccountDetails, models.AccountDetails, models.AccountDetails]{
		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()
	},
	)
}