mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-09 23:37:31 -05:00
14 lines
421 B
JavaScript
14 lines
421 B
JavaScript
const Group = require("../models/group");
|
|
|
|
exports.get_groups = async function (req, res) {
|
|
const grp_results = await Group.find({ shortName: req.params.shortName.toLowerCase()}).sort("position").catch(err => {
|
|
console.error(err);
|
|
res.status(500);
|
|
res.json({ success: false, message: err });
|
|
return;
|
|
});
|
|
|
|
res.contentType('json');
|
|
res.send(JSON.stringify(grp_results));
|
|
}
|