fix: no export getSummary in api summary

This commit is contained in:
DIYgod 2023-05-09 01:55:39 +01:00
parent be24125bd7
commit ad89272594
No known key found for this signature in database
2 changed files with 1 additions and 15 deletions

View File

@ -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 () => {

View File

@ -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)
})
}