MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / Update

Method Update

model/user.go:343–359  ·  view source on GitHub ↗
(updatePassword bool)

Source from the content-addressed store, hash-verified

341}
342
343func (user *User) Update(updatePassword bool) error {
344 var err error
345 if updatePassword {
346 user.Password, err = common.Password2Hash(user.Password)
347 if err != nil {
348 return err
349 }
350 }
351 newUser := *user
352 DB.First(&user, user.Id)
353 if err = DB.Model(user).Updates(newUser).Error; err != nil {
354 return err
355 }
356
357 // Update cache
358 return updateUserCache(*user)
359}
360
361func (user *User) Edit(updatePassword bool) error {
362 var err error

Callers 12

TelegramBindFunction · 0.95
GitHubBindFunction · 0.95
OidcBindFunction · 0.95
LinuxDoBindFunction · 0.95
UpdateSelfFunction · 0.95
ManageUserFunction · 0.95
EmailBindFunction · 0.95
WeChatBindFunction · 0.95
ResetUserPasswordByEmailFunction · 0.45
increaseUserQuotaFunction · 0.45
decreaseUserQuotaFunction · 0.45
updateUserRequestCountFunction · 0.45

Calls 2

Password2HashFunction · 0.92
updateUserCacheFunction · 0.85

Tested by

no test coverage detected