Skip to content

Commit

Permalink
add pipethrough for recids on suggestions (#3365)
Browse files Browse the repository at this point in the history
* add pipethrough

* add missing
  • Loading branch information
haileyok authored Jan 14, 2025
1 parent a44db38 commit 1705714
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/bsky/src/api/app/bsky/actor/getSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const skeleton = async (input: {
return {
dids: res.data.actors.map((a) => a.did),
cursor: res.data.cursor,
recId: res.data.recId,
resHeaders: res.headers,
}
} else {
Expand Down Expand Up @@ -129,6 +130,7 @@ const presentation = (input: {
return {
actors,
cursor: skeleton.cursor,
recId: skeleton.recId,
resHeaders: skeleton.resHeaders,
}
}
Expand All @@ -148,5 +150,6 @@ type Params = QueryParams & {
type Skeleton = {
dids: string[]
cursor?: string
recId?: number
resHeaders?: Record<string, string>
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const skeleton = async (input: SkeletonFnInput<Context, Params>) => {
return {
isFallback: !res.data.relativeToDid,
suggestedDids: res.data.actors.map((a) => a.did),
recId: res.data.recId,
headers: res.headers,
}
} else {
Expand Down Expand Up @@ -115,7 +116,12 @@ const presentation = (
const suggestions = mapDefined(suggestedDids, (did) =>
ctx.views.profileDetailed(did, hydration),
)
return { isFallback: skeleton.isFallback, suggestions, headers }
return {
isFallback: skeleton.isFallback,
suggestions,
recId: skeleton.recId,
headers,
}
}

type Context = {
Expand All @@ -133,5 +139,6 @@ type Params = QueryParams & {
type SkeletonState = {
isFallback: boolean
suggestedDids: string[]
recId?: number
headers?: Record<string, string>
}

0 comments on commit 1705714

Please sign in to comment.