Ind.ie is now Small Technology Foundation.
Commit b1e296ea authored by Frauke's avatar Frauke

only show generated codes when codes are written to db

parent bca415dc
......@@ -78,8 +78,10 @@ function generateCodes (number) {
const promise = db.write(codes[i], { created: Date.now() })
promises.push(promise)
}
Promise.all(promises).catch((err) => console.error(err))
console.log(codes)
Promise.all(promises).then(data => {
console.log('Codes below are saved to the database')
console.log(codes)
}).catch((err) => console.error(err))
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment