new version Visualizzazione Service
This commit is contained in:
@@ -449,7 +449,21 @@ const UserSchema = new mongoose.Schema({
|
||||
},
|
||||
noFoto: {
|
||||
type: Boolean,
|
||||
}
|
||||
},
|
||||
bookmark: [
|
||||
{
|
||||
_id: false,
|
||||
id: { type: String },
|
||||
tab: { type: Number },
|
||||
},
|
||||
],
|
||||
favorite: [
|
||||
{
|
||||
_id: false,
|
||||
id: { type: String },
|
||||
tab: { type: Number },
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1882,6 +1896,33 @@ UserSchema.statics.removeReqFriend = async function (
|
||||
{ $pull: { 'profile.req_friends': { username: { $in: [usernameDest] } } } });
|
||||
};
|
||||
|
||||
// Rimuovo il Favorite
|
||||
UserSchema.statics.removeFavorite = async function (
|
||||
idapp, id, tab) {
|
||||
return await User.updateOne({ idapp, username },
|
||||
{ $pull: { 'profile.favorite': { id: { $in: [id] }, tab } } });
|
||||
};
|
||||
|
||||
// Aggiungo il Favorite
|
||||
UserSchema.statics.addFavorite = async function (
|
||||
idapp, username, id, tab) {
|
||||
return await User.updateOne({ idapp, username },
|
||||
{ $push: { 'profile.favorite': { id, tab } } });
|
||||
};
|
||||
// Rimuovo il Bookmark
|
||||
UserSchema.statics.removeBookmark = async function (
|
||||
idapp, id, tab) {
|
||||
return await User.updateOne({ idapp, username },
|
||||
{ $pull: { 'profile.bookmark': { id: { $in: [id] }, tab } } });
|
||||
};
|
||||
|
||||
// Aggiungo il Bookmark
|
||||
UserSchema.statics.addBookmark = async function (
|
||||
idapp, username, id, tab) {
|
||||
return await User.updateOne({ idapp, username },
|
||||
{ $push: { 'profile.bookmark': { id, tab } } });
|
||||
};
|
||||
|
||||
UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, usernameDest, cmd, value, disablenotif) {
|
||||
|
||||
const { SendNotif } = require('../models/sendnotif');
|
||||
|
||||
Reference in New Issue
Block a user