chore: cut widget over

This commit is contained in:
Cory Dransfeldt 2023-08-22 14:18:10 -07:00
parent 96a604669b
commit 14e1945ba4
No known key found for this signature in database
4 changed files with 9 additions and 9 deletions

View file

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