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

Function decreaseUserQuota

model/user.go:707–713  ·  view source on GitHub ↗
(id int, quota int)

Source from the content-addressed store, hash-verified

705}
706
707func decreaseUserQuota(id int, quota int) (err error) {
708 err = DB.Model(&User{}).Where("id = ?", id).Update("quota", gorm.Expr("quota - ?", quota)).Error
709 if err != nil {
710 return err
711 }
712 return err
713}
714
715func DeltaUpdateUserQuota(id int, delta int) (err error) {
716 if delta == 0 {

Callers 1

DecreaseUserQuotaFunction · 0.85

Calls 1

UpdateMethod · 0.45

Tested by

no test coverage detected