소스 검색

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

JustSong 2 년 전
부모
커밋
241ade2fae
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      model/token.go

+ 1 - 1
model/token.go

@@ -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 {