add fonction notifFonction.js
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
parent
5919090a0e
commit
650b298767
@ -0,0 +1,12 @@
|
||||
const UserModel = require("../models/user.model");
|
||||
|
||||
module.exports.addNotification = (userId, notification) => {
|
||||
UserModel.findById(userId, (err, user) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
user.notif.push(notification);
|
||||
user.save();
|
||||
}
|
||||
});
|
||||
};
|
Loading…
Reference in new issue