mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +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 result = {
|
||||
[identifier]: {}
|
||||
};
|
||||
let result = {};
|
||||
|
||||
Object.keys(config)
|
||||
.forEach(
|
||||
const addons = Object.keys(config);
|
||||
if (addons) {
|
||||
|
||||
result = {
|
||||
[identifier]: {}
|
||||
};
|
||||
|
||||
addons.forEach(
|
||||
addon => Object.keys(config[addon])
|
||||
.forEach(
|
||||
component => {
|
||||
|
@ -13,7 +17,8 @@ const massageConfiguration = (config, identifier) => {
|
|||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue