fix: The client and server send the ILevel type differently
This commit is contained in:
@@ -52,11 +52,17 @@ const assert = require('assert');
|
||||
app.use("/api/user", UserRouter);
|
||||
app.get("/api/levels", async (req, res) => {
|
||||
// TODO: if (levels)
|
||||
const levels = (await db.collection("levels").find()
|
||||
const levels = (await db.collection("levels").find({}, {
|
||||
// The order in which we send the levels is important, so better
|
||||
// sort them
|
||||
sort: {
|
||||
level: 1,
|
||||
},
|
||||
})
|
||||
.toArray())
|
||||
.map((el) => {
|
||||
let tmp = Object.assign({}, el);
|
||||
delete tmp.queue;
|
||||
delete tmp.vocab;
|
||||
delete tmp._id;
|
||||
|
||||
return tmp;
|
||||
|
||||
Reference in New Issue
Block a user