Notification New Group
This commit is contained in:
@@ -29,8 +29,16 @@ async function getGroupRecAdminsInfo(idapp, data) {
|
||||
router.post('/load', authenticate, async (req, res) => {
|
||||
const idapp = req.body.idapp;
|
||||
const groupname = req.body.groupname;
|
||||
const usernameOrig = req.user.username;
|
||||
|
||||
try {
|
||||
|
||||
const {SendNotif} = require('../models/sendnotif');
|
||||
|
||||
// Check if ìs a Notif to read
|
||||
const idnotif = req.body['idnotif'] ? req.body['idnotif'] : '';
|
||||
SendNotif.setNotifAsRead(idapp, usernameOrig, idnotif);
|
||||
|
||||
const whatshow = MyGroup.getWhatToShow(idapp, req.user.username);
|
||||
let data = await MyGroup.findOne({idapp, groupname}, whatshow).lean();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user