Notification: Set a new Friendship and Accepted Friendship

This commit is contained in:
Paolo Arena
2022-07-26 15:46:39 +02:00
parent b06f1e4ab8
commit 3515914f17
15 changed files with 411 additions and 150 deletions

View File

@@ -23,13 +23,19 @@ const {ObjectID} = require('mongodb');
//GET orders
router.post('/page', authenticate, function(req, res, next) {
//++TODO: PERMESSI ???
const {SendNotif} = require('../models/sendnotif');
try {
let table = req.body.table;
let id = req.body.id;
let idapp = req.body.idapp;
const username = req.user.username ? req.user.username : '';
// Check if ìs a Notif to read
const idnotif = req.body.idnotif ? req.body.idnotif : '';
SendNotif.setNotifAsRead(idapp, username, idnotif);
let mytable = null;
if (shared_consts.TABLES_ENABLE_GETREC_BYID.includes(table)) {
mytable = globalTables.getTableByTableName(table);