Skip to content

Commit 2cea24f

Browse files
committed
fix: corrigir problema na hora do batch
1 parent 502d04f commit 2cea24f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/token.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ export async function batchCreate(tokens: ITokenPayload[]): Promise<RequestResul
138138
const failedTokens = []
139139
for (let index = 0; index < tokens.length; index++) {
140140
const token = tokens[index]
141-
const tokenRequest = await createDatabaseToken(token)
141+
const tokenRequest = await createDatabaseToken({
142+
...token,
143+
totalClaims: token.totalClaims == 0 ? Infinity : token.totalClaims,
144+
remainingClaims: token.totalClaims == 0 ? Infinity : token.totalClaims,
145+
})
146+
142147
if (tokenRequest.status !== 'success') {
143148
failedTokens.push(token.code)
144149
console.log(`Token ${token.code} deu ruim =/`)

0 commit comments

Comments
 (0)