Skip to content

Commit

Permalink
added a console.log statement in refactored code to check logs
Browse files Browse the repository at this point in the history
  • Loading branch information
njouud committed Sep 5, 2024
1 parent 31fec29 commit 6903186
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/topics/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module.exports = function (Topics) {
};

async function addEventStartEnd(postData, set, reverse, topicData) {
console.log('njoud: refactored code is running');
if (!postData.length) {
return;
}
Expand All @@ -85,6 +86,7 @@ module.exports = function (Topics) {
to set the start and end times of each post
*/
function setEventTimes(p, nextPost, reverse, topicData) {
console.log('njoud: refactored code is running (helper function 1)');
if (p && p.index === 0 && reverse) {
p.eventStart = topicData.lastposttime;
p.eventEnd = Date.now();
Expand All @@ -106,6 +108,7 @@ module.exports = function (Topics) {
helper function for last post
*/
async function handleLastPost(lastPost, set, reverse, topicData) {
console.log('njoud: refactored code is running (helper function 2)');
if (!lastPost) {
return;
}
Expand Down Expand Up @@ -134,9 +137,7 @@ module.exports = function (Topics) {
lastPost.eventEnd = nextPost[0].score;
}
}
/*
comment to push again
*/

Topics.addPostData = async function (postData, uid) {
if (!Array.isArray(postData) || !postData.length) {
return [];
Expand Down

0 comments on commit 6903186

Please sign in to comment.