feat: related posts + show tags

This commit is contained in:
Cory Dransfeldt 2024-08-25 10:44:47 -07:00
parent 9111405c3f
commit 510e07da4f
No known key found for this signature in database
19 changed files with 215 additions and 79 deletions

View file

@ -29,7 +29,8 @@ const fetchAllArtists = async () => {
albums,
concerts,
books,
movies
movies,
posts
`)
.range(rangeStart, rangeStart + PAGE_SIZE - 1)
@ -82,6 +83,13 @@ const processArtists = (artists) => {
tmdb_id: movie['tmdb_id'],
url: `/watching/movies/${movie['tmdb_id']}`,
})).sort((a, b) => b['year'] - a['year']) : null,
posts: artist['posts']?.[0]?.['id'] ? artist['posts'].map(post => ({
id: post['id'],
title: post['title'],
date: post['date'],
slug: post['slug'],
url: post['slug'],
})).sort((a, b) => new Date(b['date']) - new Date(a['date'])) : null,
}))
}