Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+7
-13
@@ -356,12 +356,14 @@ export async function getKbArticleBySlug({
|
||||
slug: string;
|
||||
language: string;
|
||||
}): Promise<KnowledgeBaseArticleWithDetails | null> {
|
||||
// cachified expects milliseconds. Keep this short until article mutations
|
||||
// publish cross-replica invalidations for this lookup.
|
||||
const publicArticleCacheTtlMs = 60_000;
|
||||
return await cachified({
|
||||
key: `kb-article:${knowledgeBaseId}:${slug}:${language}`,
|
||||
ttl: 60 * 60 * 24,
|
||||
ttl: publicArticleCacheTtlMs,
|
||||
getFreshValue: () =>
|
||||
// Public KB article fetch (cached for 24h) — replica-safe; lag is
|
||||
// well under the cache TTL.
|
||||
// Public KB article fetch — replica-safe; lag is below the short cache TTL.
|
||||
dbRead.knowledgeBaseArticle
|
||||
.findFirstOrThrow({
|
||||
where: {
|
||||
@@ -458,7 +460,7 @@ export async function updateKnowledgeBaseArticle(
|
||||
seoImage: data.seoImage,
|
||||
publishedAt: data.publishedAt,
|
||||
};
|
||||
const updated = await db.knowledgeBaseArticle
|
||||
await db.knowledgeBaseArticle
|
||||
.update({
|
||||
where: { id },
|
||||
data: update,
|
||||
@@ -603,15 +605,7 @@ export async function deleteKnowledgeBaseArticle(id: string) {
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function deleteKnowledgeBaseArticleInKnowledgeBase({
|
||||
id,
|
||||
knowledgeBaseId,
|
||||
language,
|
||||
}: {
|
||||
id: string;
|
||||
knowledgeBaseId: string;
|
||||
language: string;
|
||||
}) {
|
||||
export async function deleteKnowledgeBaseArticleInKnowledgeBase({ id, knowledgeBaseId, language }: { id: string; knowledgeBaseId: string; language: string }) {
|
||||
const item = await db.knowledgeBaseArticle.findFirst({
|
||||
where: { id, knowledgeBaseId, language },
|
||||
select: { id: true, slug: true },
|
||||
|
||||
Reference in new issue
Block a user