Skip to content
Snippets Groups Projects
Commit d9c482e7 authored by Aaron Dötsch's avatar Aaron Dötsch
Browse files

Fix voucher random code generation

parent a6bbc9a0
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ function generateRandomString(forbidden=new Set(), length=6, chars="ABCDEFGHIJKL
for(let i = 0; i < length; i++){
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
if(forbidden.has(result)) return generateRandomString(length, chars, forbidden);
if(forbidden.has(result)) return generateRandomString(forbidden, length, chars);
else return result;
}
export async function bulkCreateVouchers(amount, value, expiresAt){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment