Fix ANY types in FAQFull filter
This commit is contained in:
@@ -54,12 +54,12 @@ export default async function Page(props: {
|
||||
let faqSchema: Record<string, any> | null = null;
|
||||
const faqBlock = layout.find((b: any) => b.blockType === 'faqFull') as FAQFullBlock | undefined;
|
||||
if (faqBlock && faqBlock.questions) {
|
||||
const validQuestions = faqBlock.questions.filter((q: any) => !q.isDraft);
|
||||
const validQuestions = faqBlock.questions.filter((q: NonNullable<FAQFullBlock['questions']>[0]) => !q.isDraft);
|
||||
if (validQuestions.length > 0) {
|
||||
faqSchema = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "FAQPage",
|
||||
"mainEntity": validQuestions.map((q: any) => ({
|
||||
"mainEntity": validQuestions.map((q: NonNullable<FAQFullBlock['questions']>[0]) => ({
|
||||
"@type": "Question",
|
||||
"name": q.question,
|
||||
"acceptedAnswer": {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const FAQFullBlockComponent: React.FC<Props> = ({
|
||||
}
|
||||
|
||||
// Filter out placeholder questions
|
||||
const validQuestions = (questions || []).filter((q: any) => !q.isDraft);
|
||||
const validQuestions = (questions || []).filter((q: NonNullable<Props['questions']>[0]) => !q.isDraft);
|
||||
|
||||
// Group by category
|
||||
const groupedQuestions = validQuestions.reduce((acc, q) => {
|
||||
|
||||
Reference in New Issue
Block a user