Skip to content

Commit

Permalink
CM-213: Change moduleConfiguration reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
dborowiecki committed Jun 28, 2023
1 parent 4441533 commit 0eaf26e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/helpers/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const theme = createTheme({
drawer: {
width: 300,
fontSize: 16,
backgroundColor:"#006273"
},
appBar: {
fontSize: 16,
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ const loadConfiguration = async () => {
throw response;
} else {
const { data } = await response.json();
return data.moduleConfigurations.reduce((acc, c) => {
data.moduleConfigurations.unshift({});
const out = data.moduleConfigurations.reduce((acc, c) => {
try {
acc[c.module] = { controls: c.controls, ...JSON.parse(c.config) };
} catch (error) {
console.error(`Failed to parse module ${c.module} config`, error);
}
return acc;
}, []);
});
return out;
}
};

Expand Down

0 comments on commit 0eaf26e

Please sign in to comment.