fix: resolve conflict

This commit is contained in:
Cory Dransfeldt 2023-11-16 12:28:57 -08:00
parent 7fa65a26da
commit 6a85167ade
9 changed files with 36 additions and 47 deletions

View file

@ -35,10 +35,10 @@ module.exports = {
getPopularPosts: (posts, analytics) => {
return posts
.filter((post) => {
if (analytics.find((p) => p.url.includes(post.url))) return true
if (analytics.find((p) => p.page === post.url)) return true
})
.sort((a, b) => {
const visitors = (page) => analytics.filter((p) => p.url.includes(page.url)).pop().rank
const visitors = (page) => analytics.filter((p) => p.page === page.url).pop().visitors
return visitors(b) - visitors(a)
})
},