({params})
| 31 | } |
| 32 | |
| 33 | export async function loader({params}) { |
| 34 | const postId = decodePathParam(params.postId); |
| 35 | const {post: postObj, comments} = await getPostThread(postId); |
| 36 | |
| 37 | const authorId = postObj?.author; |
| 38 | const currentDisplayName = await getDisplayName(); |
| 39 | const editable = Boolean(authorId && currentDisplayName && authorId === currentDisplayName); |
| 40 | |
| 41 | const metadata = authorId ? await getMetadata(authorId.split("@")[0]) : {}; |
| 42 | const avatar = await getAvatar(metadata?.Avatar, authorId); |
| 43 | const latestYear = metadata?.latestYear; |
| 44 | return {postObj, comments, editable, avatar, latestYear, urlPostId: postId, currentDisplayName}; |
| 45 | } |
| 46 | |
| 47 | export async function action({request, params}) { |
| 48 | const postId = decodePathParam(params.postId); |
nothing calls this directly
no test coverage detected