Explorar o código

fix: the initial quota for new token now calculated correctly (#51)

JustSong %!s(int64=2) %!d(string=hai) anos
pai
achega
e6af636fa0
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      controller/token.go

+ 1 - 3
controller/token.go

@@ -138,9 +138,7 @@ func AddToken(c *gin.Context) {
 			})
 			return
 		}
-		if quota > 0 {
-			cleanToken.RemainQuota = quota
-		}
+		cleanToken.RemainQuota = quota
 	}
 	err = cleanToken.Insert()
 	if err != nil {