MCPcopy Create free account
hub / github.com/QuantumNous/new-api / decreaseUserQuota

Function decreaseUserQuota

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

Source from the content-addressed store, hash-verified

1093}
1094
1095func decreaseUserQuota(id int, quota int) (err error) {
1096 err = DB.Model(&User{}).Where("id = ?", id).Update("quota", gorm.Expr("quota - ?", quota)).Error
1097 if err != nil {
1098 return err
1099 }
1100 return err
1101}
1102
1103func DeltaUpdateUserQuota(id int, delta int) (err error) {
1104 if delta == 0 {

Callers 1

DecreaseUserQuotaFunction · 0.85

Calls 1

UpdateMethod · 0.45

Tested by

no test coverage detected