Skip to content

Commit

Permalink
fix(hot-tracks): add missing user info
Browse files Browse the repository at this point in the history
Contributes to #718.
  • Loading branch information
adrienjoly committed Sep 7, 2023
1 parent 62e63a8 commit 952d0f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/models/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ async function getRecentPostsByDescendingNumberOfReposts(params) {
pId: { $first: '$_id' },
name: { $first: '$name' },
img: { $first: '$img' },
uId: { $first: '$uId' },
uNm: { $first: '$uNm' },
pl: { $first: '$pl' },
nbLoves: { $sum: '$nbLoves' },
nbReposts: { $sum: '$nbR' },
Expand All @@ -170,6 +172,8 @@ async function getRecentPostsByDescendingNumberOfReposts(params) {
eId: result._id,
name: result.name,
img: result.img,
uId: result.uId,
uNm: result.uNm,
pl: result.pl,
pId: result.pId,
nbR: result.nbPosts + result.nbReposts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ exports[`Hot Tracks (approval tests - to be replaced later by unit tests) render
pId: '61e19a3f078b4c9934e72ce5',
pl: null,
score: 3,
trackUrl: '//youtube.com/watch?v=track_B'
trackUrl: '//youtube.com/watch?v=track_B',
uId: null,
uNm: null
}
]
}"
Expand Down Expand Up @@ -377,7 +379,9 @@ exports[`Hot Tracks (approval tests - to be replaced later by unit tests) render
pId: '61e19a3f078b4c9934e72ce5',
pl: null,
score: 3,
trackUrl: '//youtube.com/watch?v=track_B'
trackUrl: '//youtube.com/watch?v=track_B',
uId: null,
uNm: null
},
{
_id: '61e19a3f078b4c9934e72ce4',
Expand All @@ -392,7 +396,9 @@ exports[`Hot Tracks (approval tests - to be replaced later by unit tests) render
name: 'soundtrack of my life'
},
score: 2,
trackUrl: '//youtube.com/watch?v=track_A'
trackUrl: '//youtube.com/watch?v=track_A',
uId: null,
uNm: null
}
]
}"
Expand Down Expand Up @@ -843,7 +849,9 @@ exports[`Hot Tracks (approval tests - to be replaced later by unit tests) render
pId: '61e19a3f078b4c9934e72ce4',
pl: null,
score: 2,
trackUrl: '//youtube.com/watch?v=track_A'
trackUrl: '//youtube.com/watch?v=track_A',
uId: null,
uNm: null
}
]
}"
Expand Down

0 comments on commit 952d0f4

Please sign in to comment.