fix: no export getSummary in api summary
This commit is contained in:
parent
be24125bd7
commit
ad89272594
|
|
@ -70,7 +70,7 @@ const getOriginalSummary = async (cid: string, lang: string) => {
|
|||
}
|
||||
}
|
||||
|
||||
export async function getSummary(cid: string, lang: string = "en") {
|
||||
async function getSummary(cid: string, lang: string = "en") {
|
||||
const summary = await cacheGet({
|
||||
key: ["summary", cid, lang],
|
||||
getValueFun: async () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { QueryClient } from "@tanstack/react-query"
|
||||
|
||||
import { getSummary } from "~/app/api/summary/route"
|
||||
import { getNoteSlug } from "~/lib/helpers"
|
||||
import { cacheDelete, cacheGet } from "~/lib/redis.server"
|
||||
import * as pageModel from "~/models/page.model"
|
||||
|
|
@ -119,16 +118,3 @@ export const fetchGetPagesBySite = async (
|
|||
}) as Promise<ReturnType<typeof pageModel.getPagesBySite>>
|
||||
})
|
||||
}
|
||||
|
||||
export const prefetchGetSummary = async (
|
||||
input: { cid?: string; lang?: string },
|
||||
queryClient: QueryClient,
|
||||
) => {
|
||||
const key = ["getSummary", input.cid, input.lang]
|
||||
await queryClient.fetchQuery(key, async () => {
|
||||
if (!input.cid || !input.lang) {
|
||||
return
|
||||
}
|
||||
return getSummary(input.cid, input.lang)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue