feat: skip skipExpansion for archives and tags long list
This commit is contained in:
parent
4b9827305b
commit
3fc114bc6b
|
|
@ -12,6 +12,7 @@ export async function GET(req: Request) {
|
|||
limit: query.limit ? parseInt(query.limit as string) : undefined,
|
||||
cursor: query.cursor as string,
|
||||
useStat: true,
|
||||
skipExpansion: query.skipExpansion === "true",
|
||||
...(query.tags && {
|
||||
tags: Array.isArray(query.tags)
|
||||
? (query.tags as string[])
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ export default async function SiteArchivesPage({
|
|||
type: "post",
|
||||
visibility: PageVisibilityEnum.Published,
|
||||
limit: 100,
|
||||
skipExpansion: true,
|
||||
},
|
||||
queryClient,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export default async function SiteTagPage({
|
|||
type: "post",
|
||||
visibility: PageVisibilityEnum.Published,
|
||||
limit: 100,
|
||||
skipExpansion: true,
|
||||
tags: [params.tag],
|
||||
},
|
||||
queryClient,
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@ export const SiteArchives = () => {
|
|||
const site = useGetSite(params?.site as string)
|
||||
const posts = useGetPagesBySiteLite({
|
||||
characterId: site.data?.characterId,
|
||||
limit: 100,
|
||||
type: "post",
|
||||
visibility: PageVisibilityEnum.Published,
|
||||
limit: 100,
|
||||
skipExpansion: true,
|
||||
...(params?.tag && { tags: [params.tag as string] }),
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ export async function getPagesBySite(input: {
|
|||
useHTML?: boolean
|
||||
keepBody?: boolean
|
||||
handle?: string // In order to be compatible with old drafts
|
||||
skipExpansion?: boolean
|
||||
}) {
|
||||
if (!input.characterId) {
|
||||
return {
|
||||
|
|
@ -185,12 +186,14 @@ export async function getPagesBySite(input: {
|
|||
pinnedNoteId: pinnedNote?.noteId,
|
||||
list: await Promise.all(
|
||||
list.map(async (note) => {
|
||||
const expanded = await expandCrossbellNote({
|
||||
note,
|
||||
useStat: input.useStat,
|
||||
useHTML: input.useHTML,
|
||||
useScore: false,
|
||||
})
|
||||
const expanded = input.skipExpansion
|
||||
? (note as ExpandedNote)
|
||||
: await expandCrossbellNote({
|
||||
note,
|
||||
useStat: input.useStat,
|
||||
useHTML: input.useHTML,
|
||||
useScore: false,
|
||||
})
|
||||
|
||||
if (!input.keepBody) {
|
||||
delete expanded.metadata?.content?.content
|
||||
|
|
|
|||
Loading…
Reference in New Issue