better levelid system
This commit is contained in:
parent
f83da9c36f
commit
e39a550b9a
|
@ -1,6 +1,12 @@
|
|||
module.exports = (app, db): void => {
|
||||
app.post('/aa/database/uploadGJLevel21.php', async (req, res) => {
|
||||
let levelID = await db.collection('levels').find({}).count() + 1;
|
||||
let levels = await db.collection('levels')
|
||||
.find({})
|
||||
.toArray();
|
||||
|
||||
levels.sort((a, b) => b.id - a.id);
|
||||
|
||||
let levelID = levels[0].id + 1;
|
||||
|
||||
console.log(req.body);
|
||||
|
||||
|
|
Loading…
Reference in New Issue