From 5e8c54e7ee48b3077c425b435f8eeb727746f168 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Fri, 15 Nov 2024 12:43:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20algolia=20updatedAt=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baker/algolia/utils/pages.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/baker/algolia/utils/pages.ts b/baker/algolia/utils/pages.ts index 24d6d2781cb..d6303b2fd06 100644 --- a/baker/algolia/utils/pages.ts +++ b/baker/algolia/utils/pages.ts @@ -223,7 +223,9 @@ function generateGdocRecords( views_7d: pageviews[`/${gdoc.slug}`]?.views_7d ?? 0, excerpt: gdoc.content.excerpt, date: gdoc.publishedAt!.toISOString(), - modifiedDate: gdoc.updatedAt!.toISOString(), + modifiedDate: ( + gdoc.updatedAt ?? gdoc.publishedAt! + ).toISOString(), tags: gdoc.tags?.map((t) => t.name), documentType: "gdoc" as const, authors: gdoc.content.authors,