Fix post likes

This commit is contained in:
Adolfo Reyna
2023-07-10 20:24:29 -04:00
parent 6b24947b56
commit bffe227ad4

View File

@@ -38,7 +38,7 @@ postDB = (DB)=>{
}); });
} }
DB.newReaction = (songId, profileid, reaction) => { DB.newReactionInSong = (songId, profileid, reaction) => {
if(!DB.ObjectID.isValid(songId)) return false; if(!DB.ObjectID.isValid(songId)) return false;
const id = DB.ObjectID(songId); const id = DB.ObjectID(songId);
let update = { let update = {
@@ -53,7 +53,7 @@ postDB = (DB)=>{
}); });
} }
DB.removeReaction = (songId, profileid) => { DB.removeReactionInSong = (songId, profileid) => {
if(!DB.ObjectID.isValid(songId)) return false; if(!DB.ObjectID.isValid(songId)) return false;
const id = DB.ObjectID(songId); const id = DB.ObjectID(songId);
let update = { let update = {
@@ -70,7 +70,7 @@ postDB = (DB)=>{
}); });
} }
DB.newComment = (songId, comment) => { DB.newCommentInSong = (songId, comment) => {
if(!DB.ObjectID.isValid(songId)) return false; if(!DB.ObjectID.isValid(songId)) return false;
const id = DB.ObjectID(songId); const id = DB.ObjectID(songId);
return DB.songsCol.updateOne({_id: id}, { return DB.songsCol.updateOne({_id: id}, {
@@ -86,7 +86,7 @@ postDB = (DB)=>{
}); });
} }
DB.newCommentReaction = (songId, commentDate, profileid, reaction) => { DB.newCommentReactionInSong = (songId, commentDate, profileid, reaction) => {
if(!DB.ObjectID.isValid(songId)) return false; if(!DB.ObjectID.isValid(songId)) return false;
const id = DB.ObjectID(songId); const id = DB.ObjectID(songId);
let update = { let update = {
@@ -105,7 +105,7 @@ postDB = (DB)=>{
}); });
} }
DB.removeCommentReaction = (songId, commentDate, profileid) => { DB.removeCommentReactionInSong = (songId, commentDate, profileid) => {
if(!DB.ObjectID.isValid(songId)) return false; if(!DB.ObjectID.isValid(songId)) return false;
const id = DB.ObjectID(songId); const id = DB.ObjectID(songId);
let update = { let update = {