diff --git a/app/server-utils/stampy.ts b/app/server-utils/stampy.ts index 545a34e7..6fb80eb4 100644 --- a/app/server-utils/stampy.ts +++ b/app/server-utils/stampy.ts @@ -381,7 +381,12 @@ export const loadBanners = withCache('loadBanners', async (): Promise { const rows = (await getCodaRows(ON_SITE_TABLE)) as AnswersRow[] - return rows.map(convertToQuestion) + const cleaned = rows.map(convertToQuestion) + const questionIds = cleaned.map((q) => q.pageid) + return cleaned.map((q) => ({ + ...q, + relatedQuestions: q.relatedQuestions.filter(({pageid}) => questionIds.includes(pageid)), + })) }) export const loadAllQuestions = withCache('allQuestions', async () => {