mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 05:02:50 +08:00
refactor(massageConfiguration): Create response only when we have addons
Signed-off-by: Adrian Oprea <adrian@oprea.rocks>
This commit is contained in:
parent
d71f6161e4
commit
4b9013bcab
1 changed files with 11 additions and 6 deletions
|
@ -1,10 +1,14 @@
|
||||||
const massageConfiguration = (config, identifier) => {
|
const massageConfiguration = (config, identifier) => {
|
||||||
const result = {
|
let result = {};
|
||||||
[identifier]: {}
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.keys(config)
|
const addons = Object.keys(config);
|
||||||
.forEach(
|
if (addons) {
|
||||||
|
|
||||||
|
result = {
|
||||||
|
[identifier]: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
addons.forEach(
|
||||||
addon => Object.keys(config[addon])
|
addon => Object.keys(config[addon])
|
||||||
.forEach(
|
.forEach(
|
||||||
component => {
|
component => {
|
||||||
|
@ -13,7 +17,8 @@ const massageConfiguration = (config, identifier) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue