Skip to content

Commit

Permalink
Merge pull request #793 from yeatmanlab/enh/for-each-fallback
Browse files Browse the repository at this point in the history
Add fallback values before calling the forEach method
  • Loading branch information
richford authored Sep 12, 2024
2 parents dd9a07f + 337e348 commit 71bc630
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@bdelab/roam-fluency": "1.11.26",
"@bdelab/roar-firekit": "^8.0.7",
"@bdelab/roar-firekit": "^8.0.8",
"@bdelab/roar-letter": "1.11.5",
"@bdelab/roar-multichoice": "^1.11.3",
"@bdelab/roar-pa": "2.2.4",
Expand Down
6 changes: 3 additions & 3 deletions src/components/CardAdministration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ const fetchTreeOrgs = async () => {
treeTableOrgs.push(...dsgfOrgs.filter((node) => node.data.orgType === 'group'));
treeTableOrgs.push(...dsgfOrgs.filter((node) => node.data.orgType === 'family'));

treeTableOrgs.forEach((node) => {
(treeTableOrgs ?? []).forEach((node) => {
// Sort the schools by existance of stats then alphabetically
if (node.children) {
node.children.sort((a, b) => {
Expand Down Expand Up @@ -499,8 +499,8 @@ const onExpand = async (node) => {
});

// Sort the classes by existance of stats then alphabetically
newNodes.forEach((districtNode) => {
districtNode.children.forEach((schoolNode) => {
(newNodes ?? []).forEach((districtNode) => {
(districtNode?.children ?? []).forEach((schoolNode) => {
if (schoolNode.children) {
schoolNode.children.sort((a, b) => {
if (!a.data.stats) return 1;
Expand Down

0 comments on commit 71bc630

Please sign in to comment.