Commit 929f87d1 by JustSong

fix: delete a token with a negative quota will now update the account's quota correctly (close #51)

parent 587112ce
......@@ -121,7 +121,7 @@ func DeleteTokenById(id int, userId int) (err error) {
if quota > 0 {
err = IncreaseUserQuota(userId, quota)
} else {
err = DecreaseUserQuota(userId, quota)
err = DecreaseUserQuota(userId, -quota)
}
}
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment