mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
setup: fix config application
recent change means app.ModifyConfig requires app.confiBase, which was not read in from the YAML file in setup. It is now loaded before the "if !firstRun" branch.
This commit is contained in:
7
api.go
7
api.go
@@ -262,7 +262,12 @@ func (app *appContext) ModifyConfig(gc *gin.Context) {
|
||||
newSection := ns.(map[string]any)
|
||||
iniSection, err := tempConfig.GetSection(section.Section)
|
||||
if err != nil {
|
||||
iniSection, _ = tempConfig.NewSection(section.Section)
|
||||
iniSection, err = tempConfig.NewSection(section.Section)
|
||||
if err != nil {
|
||||
app.err.Printf(lm.FailedModifyConfig, app.configPath, err)
|
||||
respond(500, err.Error(), gc)
|
||||
return
|
||||
}
|
||||
}
|
||||
for _, setting := range section.Settings {
|
||||
newValue, ok := newSection[setting.Setting]
|
||||
|
||||
Reference in New Issue
Block a user