diff --git a/src/index.ts b/src/index.ts index b41ec92..fb9c443 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,22 +64,22 @@ app.get('/generate', async (req: Request, res: Response,) => { return res.status(401).json({ message: 'Unauthorized' }) } try { - makeGain(100, Cadeaux.GrandCoffretDecouverte) + await makeGain(100, Cadeaux.GrandCoffretDecouverte) - // makeGain(60000, Cadeaux.GrandCoffretDecouverte) - // makeGain(90000, Cadeaux.CoffretDecouverte) - // makeGain(150000, Cadeaux.TheSignature) + await makeGain(60000, Cadeaux.GrandCoffretDecouverte) + await makeGain(90000, Cadeaux.CoffretDecouverte) + await makeGain(150000, Cadeaux.TheSignature) - // for (let i = 0; i < 2; i++) { - // makeGain(150000, Cadeaux.TheDetox) - // } + for (let i = 0; i < 2; i++) { + await makeGain(150000, Cadeaux.TheDetox) + } - // for (let i = 0; i < 6; i++) { - // makeGain(150000, Cadeaux.Infuseur) - // } + for (let i = 0; i < 6; i++) { + await makeGain(150000, Cadeaux.Infuseur) + } - const totalGains = await prisma.gain.count({}) + const totalGains = await prisma.gain.count() console.log('total', totalGains); diff --git a/utils/makeGain.ts b/utils/makeGain.ts index d02a293..6fdae5f 100644 --- a/utils/makeGain.ts +++ b/utils/makeGain.ts @@ -25,6 +25,9 @@ export const makeGain = async (nbrGain: number, idProduit: number) => { console.log(`produit : ${Cadeaux[idProduit]}, n° : ${i}`) } + setTimeout(() => { + console.log('wait...') + }, 1000) @@ -32,5 +35,5 @@ export const makeGain = async (nbrGain: number, idProduit: number) => { data: generatedGains }) - console.log('YEYEEEEEEEEEEEEE', res); + console.log('Gain created !', res); }