upgraded most of the Backend

This commit is contained in:
Luke Berndt
2023-04-08 12:57:12 -04:00
parent 329dc7f47b
commit 6ae3f25215
14 changed files with 977 additions and 3068 deletions

View File

@@ -1,12 +1,11 @@
var db = require('../db');
exports.get_groups = function(req, res) {
db.get().collection('groups', function(err, grp_coll) {
grp_coll.find({
'shortName': req.params.shortName.toLowerCase()
}).toArray(function(err, grp_results) {
res.contentType('json');
res.send(JSON.stringify(grp_results));
});
});
exports.get_groups = async function (req, res) {
const grp_coll = db.get().collection('groups');
const cursor = grp_coll.find({ 'shortName': req.params.shortName.toLowerCase() });
const grp_results = await cursor.toArray();
res.contentType('json');
res.send(JSON.stringify(grp_results));
}