···3333 }
34343535 // Convert the main post to a PostView
3636- const mainPostView = await transformPostToPostView(mainPost, ctx.db, ctx.resolver, userDid)
3636+ const mainPostView = await transformPostToPostView(mainPost, ctx.db, userDid)
37373838 // Get parent posts if this is a reply
3939 const parentPosts: SoSprkFeedDefs.PostView[] = []
···5050 break
5151 }
52525353- const parentPostView = await transformPostToPostView(parentPost, ctx.db, ctx.resolver, userDid)
5353+ const parentPostView = await transformPostToPostView(parentPost, ctx.db, userDid)
5454 parentPosts.unshift(parentPostView) // Add at the beginning so root is first
55555656 // If we reached the root, stop
···125125 depth = 0,
126126): Promise<SoSprkFeedDefs.ThreadViewPost> {
127127 // Convert the post to a post view
128128- const postView = await transformPostToPostView(post, ctx.db, ctx.resolver, userDid)
128128+ const postView = await transformPostToPostView(post, ctx.db, userDid)
129129130130 // If we've reached the maximum depth, don't fetch replies
131131 if (depth <= 0) {
+2-4
services/appview/src/routes/feed/getPosts.ts
···33import { OutputSchema as GetPostsView } from '../../lexicon/types/so/sprk/feed/getPosts.js'
44import { AppContext } from '../../index.js'
55import { transformPostToPostView } from '../../utils/post-transformer.js'
66-import { BidirectionalResolver } from '../../id-resolver.js'
76import { Database } from '../../db.js'
87import type * as SoSprkFeedDefs from '../../lexicon/types/so/sprk/feed/defs.js'
98···1110async function getPosts(
1211 uris: string | string[],
1312 db: Database,
1414- resolver: BidirectionalResolver,
1513 userDid?: string,
1614): Promise<SoSprkFeedDefs.PostView[]> {
1715 if (!uris) {
···28262927 // Transform each post to PostView format
3028 const postViews = await Promise.all(
3131- dbPosts.map((post) => transformPostToPostView(post, db, resolver, userDid)),
2929+ dbPosts.map((post) => transformPostToPostView(post, db, userDid)),
3230 )
33313432 return postViews
···4543 return c.json({ posts: [] } as GetPostsView)
4644 }
47454848- const posts = await getPosts(uris, ctx.db, ctx.resolver, userDid)
4646+ const posts = await getPosts(uris, ctx.db, userDid)
49475048 return c.json({ posts } as GetPostsView)
5149 })
-2
services/appview/src/utils/post-transformer.ts
···44import type * as SoSprkEmbedImages from '../lexicon/types/so/sprk/embed/images.js'
55import type * as SoSprkEmbedVideo from '../lexicon/types/so/sprk/embed/video.js'
66import { Database, PostDocument } from '../db.js'
77-import { BidirectionalResolver } from '../id-resolver.js'
8798// Transform DB post to PostView format
109export async function transformPostToPostView(
1110 post: PostDocument,
1211 db: Database,
1313- resolver: BidirectionalResolver,
1412 userDid?: string,
1513): Promise<SoSprkFeedDefs.PostView> {
1614 // Get like count