From a73428706c29193b5a0f19dd3f77b0c99324d2bc Mon Sep 17 00:00:00 2001 From: Jack Murray-Brown Date: Thu, 7 Nov 2024 11:34:09 +0100 Subject: [PATCH] remove null artists who are unpublished on a published show (#144) --- util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util.ts b/util.ts index 25a225d..20b3771 100644 --- a/util.ts +++ b/util.ts @@ -108,7 +108,9 @@ export const sortAndGroup = (data: AllArtistEntry[]): GroupedArtists[] => { }; export const formatArtistNames = (data: ArtistInterface[]) => { - const names = data.map(({ name }) => name); + // remove null artists who are unpublished on a published show + const filteredData = data.filter((artist) => artist !== null); + const names = filteredData.map(({ name }) => name); if (names.length === 1) { return `with ${names[0]}`;