diff --git a/services/appview/src/routes/feed/getAuthorFeed.ts b/services/appview/src/routes/feed/getAuthorFeed.ts index fb1c07c..0fb3620 100644 --- a/services/appview/src/routes/feed/getAuthorFeed.ts +++ b/services/appview/src/routes/feed/getAuthorFeed.ts @@ -141,7 +141,6 @@ export const createGetAuthorFeedRouter = (ctx: AppContext) => { const postView = await transformPostToPostView( post, ctx.db, - ctx.resolver, viewerDid, ) diff --git a/services/appview/src/routes/feed/getPostThread.ts b/services/appview/src/routes/feed/getPostThread.ts index cede6e7..f0a400c 100644 --- a/services/appview/src/routes/feed/getPostThread.ts +++ b/services/appview/src/routes/feed/getPostThread.ts @@ -33,7 +33,7 @@ export const createGetPostThreadRouter = (ctx: AppContext) => { } // Convert the main post to a PostView - const mainPostView = await transformPostToPostView(mainPost, ctx.db, ctx.resolver, userDid) + const mainPostView = await transformPostToPostView(mainPost, ctx.db, userDid) // Get parent posts if this is a reply const parentPosts: SoSprkFeedDefs.PostView[] = [] @@ -50,7 +50,7 @@ export const createGetPostThreadRouter = (ctx: AppContext) => { break } - const parentPostView = await transformPostToPostView(parentPost, ctx.db, ctx.resolver, userDid) + const parentPostView = await transformPostToPostView(parentPost, ctx.db, userDid) parentPosts.unshift(parentPostView) // Add at the beginning so root is first // If we reached the root, stop @@ -125,7 +125,7 @@ async function buildThreadView( depth = 0, ): Promise { // Convert the post to a post view - const postView = await transformPostToPostView(post, ctx.db, ctx.resolver, userDid) + const postView = await transformPostToPostView(post, ctx.db, userDid) // If we've reached the maximum depth, don't fetch replies if (depth <= 0) { diff --git a/services/appview/src/routes/feed/getPosts.ts b/services/appview/src/routes/feed/getPosts.ts index 8106db6..9f0859e 100644 --- a/services/appview/src/routes/feed/getPosts.ts +++ b/services/appview/src/routes/feed/getPosts.ts @@ -3,7 +3,6 @@ import { Hono } from 'hono' import { OutputSchema as GetPostsView } from '../../lexicon/types/so/sprk/feed/getPosts.js' import { AppContext } from '../../index.js' import { transformPostToPostView } from '../../utils/post-transformer.js' -import { BidirectionalResolver } from '../../id-resolver.js' import { Database } from '../../db.js' import type * as SoSprkFeedDefs from '../../lexicon/types/so/sprk/feed/defs.js' @@ -11,7 +10,6 @@ import type * as SoSprkFeedDefs from '../../lexicon/types/so/sprk/feed/defs.js' async function getPosts( uris: string | string[], db: Database, - resolver: BidirectionalResolver, userDid?: string, ): Promise { if (!uris) { @@ -28,7 +26,7 @@ async function getPosts( // Transform each post to PostView format const postViews = await Promise.all( - dbPosts.map((post) => transformPostToPostView(post, db, resolver, userDid)), + dbPosts.map((post) => transformPostToPostView(post, db, userDid)), ) return postViews @@ -45,7 +43,7 @@ export const createGetPostsRouter = (ctx: AppContext) => { return c.json({ posts: [] } as GetPostsView) } - const posts = await getPosts(uris, ctx.db, ctx.resolver, userDid) + const posts = await getPosts(uris, ctx.db, userDid) return c.json({ posts } as GetPostsView) }) diff --git a/services/appview/src/utils/post-transformer.ts b/services/appview/src/utils/post-transformer.ts index 6e9c8f2..f65a8b1 100644 --- a/services/appview/src/utils/post-transformer.ts +++ b/services/appview/src/utils/post-transformer.ts @@ -4,13 +4,11 @@ import type { Label } from '../lexicon/types/com/atproto/label/defs.js' import type * as SoSprkEmbedImages from '../lexicon/types/so/sprk/embed/images.js' import type * as SoSprkEmbedVideo from '../lexicon/types/so/sprk/embed/video.js' import { Database, PostDocument } from '../db.js' -import { BidirectionalResolver } from '../id-resolver.js' // Transform DB post to PostView format export async function transformPostToPostView( post: PostDocument, db: Database, - resolver: BidirectionalResolver, userDid?: string, ): Promise { // Get like count