feat: auto-update JSON template with environment params
This commit is contained in:
@@ -49,12 +49,14 @@ function App() {
|
||||
}
|
||||
return newEnvs;
|
||||
});
|
||||
|
||||
// Also update config.envs to keep it in sync
|
||||
|
||||
// Also update config.envs and template to keep them in sync
|
||||
setConfig(prevConfig => {
|
||||
const newConfig = new Config();
|
||||
newConfig.envs = prevConfig.envs.map(e => e.id === env.id ? env : e);
|
||||
// Update template JSON with params from this environment
|
||||
newConfig.template = prevConfig.template;
|
||||
newConfig.updateTemplateFromEnv(env);
|
||||
return newConfig;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user