mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 09:48:10 -05:00
reduced Admin messages
This commit is contained in:
@@ -110,7 +110,7 @@ exports.deleteGroup = async function (req, res, next) {
|
|||||||
|
|
||||||
|
|
||||||
exports.reorderGroups = function (req, res, next) {
|
exports.reorderGroups = function (req, res, next) {
|
||||||
console.log(req.body)
|
|
||||||
//router.post('/system/:shortName/group_order', isLoggedIn, function(req, res) {
|
//router.post('/system/:shortName/group_order', isLoggedIn, function(req, res) {
|
||||||
process.nextTick(async function () {
|
process.nextTick(async function () {
|
||||||
const system = await System.findOne({ shortName: req.params.shortName.toLowerCase() });
|
const system = await System.findOne({ shortName: req.params.shortName.toLowerCase() });
|
||||||
@@ -131,7 +131,7 @@ exports.reorderGroups = function (req, res, next) {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(req.body)
|
|
||||||
if (!req.body.groupOrder) {
|
if (!req.body.groupOrder) {
|
||||||
res.status(500);
|
res.status(500);
|
||||||
res.json({
|
res.json({
|
||||||
@@ -142,8 +142,6 @@ exports.reorderGroups = function (req, res, next) {
|
|||||||
}
|
}
|
||||||
var groupOrder = JSON.parse(req.body.groupOrder);
|
var groupOrder = JSON.parse(req.body.groupOrder);
|
||||||
for (var i = 0; i < groupOrder.length; i++) {
|
for (var i = 0; i < groupOrder.length; i++) {
|
||||||
|
|
||||||
console.log("in group: " + groupOrder[i] + " position: " + i);
|
|
||||||
const group = await Group.findOneAndUpdate(
|
const group = await Group.findOneAndUpdate(
|
||||||
{
|
{
|
||||||
_id: new mongoose.Types.ObjectId(groupOrder[i]),
|
_id: new mongoose.Types.ObjectId(groupOrder[i]),
|
||||||
@@ -177,10 +175,8 @@ exports.reorderGroups = function (req, res, next) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.upsertGroup = function (req, res, next) {
|
exports.upsertGroup = function (req, res, next) {
|
||||||
console.log(req.body)
|
|
||||||
//router.post('/system/:shortName/group/:groupId?', isLoggedIn, function(req, res) {
|
//router.post('/system/:shortName/group/:groupId?', isLoggedIn, function(req, res) {
|
||||||
process.nextTick(async function () {
|
process.nextTick(async function () {
|
||||||
console.log(req.body)
|
|
||||||
let system = await System.findOne({ shortName: req.params.shortName.toLowerCase() });
|
let system = await System.findOne({ shortName: req.params.shortName.toLowerCase() });
|
||||||
|
|
||||||
if (!system) {
|
if (!system) {
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ exports.listUserSystems = async function (req,res,next) {
|
|||||||
}
|
}
|
||||||
const users = await User.find({}, "_id email firstName lastName lastLogin");
|
const users = await User.find({}, "_id email firstName lastName lastLogin");
|
||||||
let list = [];
|
let list = [];
|
||||||
console.log(users);
|
|
||||||
for (let index = 0; index < users.length; index++) {
|
for (let index = 0; index < users.length; index++) {
|
||||||
let user = users[index].toObject();
|
let user = users[index].toObject();
|
||||||
const userId = new mongoose.Types.ObjectId(user._id);
|
const userId = new mongoose.Types.ObjectId(user._id);
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ async function csv_import(shortName, filename, callback) {
|
|||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var row = data[i];
|
var row = data[i];
|
||||||
console.log(row)
|
|
||||||
if (!( "Decimal" in row) || !("Description" in row) || !("Alpha Tag" in row)) {
|
if (!( "Decimal" in row) || !("Description" in row) || !("Alpha Tag" in row)) {
|
||||||
console.error("Error: csv import column header error");
|
console.error("Error: csv import column header error");
|
||||||
callback("Column Headers are required - Required Columns: 'Decimal' 'Decscription' 'Alpha Tag' Optional Column: 'Priority' ", null);
|
callback("Column Headers are required - Required Columns: 'Decimal' 'Decscription' 'Alpha Tag' Optional Column: 'Priority' ", null);
|
||||||
|
|||||||
Reference in New Issue
Block a user