type=all for a conglomerate of all the levels

This commit is contained in:
Jill 2024-02-03 19:12:41 +03:00
parent ea79f45f74
commit 2909d835ae
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,12 @@ app.get('/list', (req, res) => {
list = platformerLevels;
} else if (type === 'pending') {
list = pendingLevels;
} else if (type === 'all') {
return res.json([
...regularLevels.map(l => ({ type: 'regular', ...l })),
...platformerLevels.map(l => ({ type: 'platformer', ...l })),
...pendingLevels.map(l => ({ type: 'pending', ...l })),
]);
} else {
return res.status(400);
}