Skip to content

Commit

Permalink
Fix for feedback_emails array / string format (#422)
Browse files Browse the repository at this point in the history
Spec has them as array output
  • Loading branch information
gkovats authored Oct 6, 2024
1 parent f13e406 commit 4127c30
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
4 changes: 2 additions & 2 deletions public/app.js

Large diffs are not rendered by default.

32 changes: 28 additions & 4 deletions public/data/atlanta.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@
"group_id": 65346,
"group": "Serenity and Spirituality",
"website": "https://howplace.org/",
"attendance_option": "in_person"
"attendance_option": "in_person",
"entity": "Site Group",
"entity_email": "[email protected]",
"entity_phone": "555-555-4567",
"entity_location": "Macon, Georgia",
"entity_url": "http://site.com",
"feedback_emails": "[email protected],[email protected]"
},
{
"id": 65411,
Expand All @@ -80,7 +86,13 @@
"region": "Acworth",
"regions": ["Acworth"],
"website": "https://howplace.org/",
"attendance_option": "in_person"
"attendance_option": "in_person",
"entity": "Site Group",
"entity_email": "[email protected]",
"entity_phone": "555-555-4567",
"entity_location": "Macon, Georgia",
"entity_url": "http://site.com",
"feedback_emails": ["[email protected]", "[email protected]"]
},
{
"id": 65483,
Expand Down Expand Up @@ -108,7 +120,13 @@
"group_id": 65482,
"group": "Original H.O.W.",
"website": "https://howplace.org/",
"attendance_option": "in_person"
"attendance_option": "in_person",
"entity": "Site Group",
"entity_email": "[email protected]",
"entity_phone": "555-555-4567",
"entity_location": "Macon, Georgia",
"entity_url": "http://site.com",
"feedback_emails": ["[email protected]", "[email protected]"]
},
{
"id": 65376,
Expand Down Expand Up @@ -164,6 +182,12 @@
"group_id": 65374,
"group": "Covington",
"last_contact": "2021-08-16",
"attendance_option": "in_person"
"attendance_option": "in_person",
"entity": "Site Group",
"entity_email": "[email protected]",
"entity_phone": "555-555-4567",
"entity_location": "Macon, Georgia",
"entity_url": "http://site.com",
"feedback_emails": ["[email protected]", "[email protected]"]
}
]
16 changes: 10 additions & 6 deletions src/helpers/load-meeting-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,16 @@ export function loadMeetingData(
.join('\t')
.toLowerCase();

const feedback_emails = meeting.feedback_emails
? meeting.feedback_emails
.split(',')
.map(e => e.trim())
.filter(e => e)
: settings.feedback_emails;
let feedback_emails = settings.feedback_emails;
if (Array.isArray(meeting.feedback_emails)) {
feedback_emails = meeting.feedback_emails;
}
if ('string' === typeof meeting.feedback_emails) {
feedback_emails = meeting.feedback_emails
.split(',')
.map(e => e.trim())
.filter(e => e);
}

if (!feedback_url && feedback_emails.length) {
feedback_url = formatFeedbackEmail({
Expand Down

0 comments on commit 4127c30

Please sign in to comment.