diff --git a/api/user.go b/api/user.go index 7a38b0e59..0903f086c 100644 --- a/api/user.go +++ b/api/user.go @@ -311,10 +311,20 @@ func UpdateUser(c *gin.Context) { // update user fields if provided if input.GetActive() { - // update active if set + // update active if set to true u.SetActive(input.GetActive()) } + if input.GetAdmin() { + // update admin if set to true + u.SetAdmin(input.GetAdmin()) + } + + if input.Favorites != nil { + // update favorites if set + u.SetFavorites(input.GetFavorites()) + } + // send API call to update the user err = database.FromContext(c).UpdateUser(u) if err != nil {