Refactor post meta to return PostView (#5645)

This commit is contained in:
dan
2024-10-24 20:41:50 +01:00
committed by GitHub
parent fa4cca11fe
commit e8a53dcea8
9 changed files with 37 additions and 106 deletions
+3 -12
View File
@@ -1,6 +1,5 @@
import {
AppBskyActorDefs,
AppBskyFeedPost,
AppBskyFeedDefs,
AppBskyGraphStarterpack,
ComAtprotoRepoStrongRef,
} from '@atproto/api'
@@ -41,11 +40,7 @@ type ResolvedPostRecord = {
type: 'record'
record: ComAtprotoRepoStrongRef.Main
kind: 'post'
meta: {
text: string
indexedAt: string
author: AppBskyActorDefs.ProfileViewBasic
}
meta: AppBskyFeedDefs.PostView
}
type ResolvedOtherRecord = {
@@ -92,11 +87,7 @@ export async function resolveLink(
uri: post.uri,
},
kind: 'post',
meta: {
text: AppBskyFeedPost.isRecord(post.record) ? post.record.text : '',
indexedAt: post.indexedAt,
author: post.author,
},
meta: post,
}
}
if (isBskyCustomFeedUrl(uri)) {