Skip to content

Commit

Permalink
Handle empty answer rows
Browse files Browse the repository at this point in the history
  • Loading branch information
tewson committed Apr 9, 2024
1 parent 797b4bb commit 42a5821
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/areas/[localAuthority]/[area].astro
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function getStaticPaths() {
.map((questionRecord) => {
const answersForQuestion = answers.filter(
(answerRecord) =>
getLookupFieldValue(answerRecord, "Candidate area name") ===
getOptionalLookupFieldValue(answerRecord, "Candidate area name") ===
electoralAreaName &&
answerRecord.get("Question")?.toString() === questionRecord.id
);
Expand Down
3 changes: 2 additions & 1 deletion src/pages/candidates/[candidate].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { marked } from "marked";
import {
airtableClient,
getLookupFieldValue,
getOptionalLookupFieldValue,
getOptionalStringFieldValue,
getStringFieldValue,
} from "../../airtable-api";
Expand Down Expand Up @@ -56,7 +57,7 @@ export async function getStaticPaths() {
.map((questionRecord) => {
const answerRecord = answerRecords.filter((answerRecord) => {
return (
getLookupFieldValue(answerRecord, "Candidate full name") ===
getOptionalLookupFieldValue(answerRecord, "Candidate full name") ===
candidateFullName &&
answerRecord.get("Question")?.toString() === questionRecord.id
);
Expand Down

0 comments on commit 42a5821

Please sign in to comment.