fix(web): preserve aw_url when a settings POST omits it
A UI save was silently blanking the configured AW URL because handlePostSettings bound the whole Settings from the request and saved it as-is. Now reads s.settings.AWURL under the existing settingsMu lock and carries it forward when req.AWURL is empty, so fields not exposed in the form are never erased.
This commit is contained in:
@@ -45,6 +45,11 @@ func (s *Server) handlePostSettings(c *gin.Context) {
|
||||
s.settingsMu.Lock()
|
||||
apply := s.applyFn
|
||||
path := s.settingsPath
|
||||
// aw_url is not exposed in the settings form; preserve the persisted value
|
||||
// so a UI save never blanks a configured AW URL.
|
||||
if req.AWURL == "" {
|
||||
req.AWURL = s.settings.AWURL
|
||||
}
|
||||
s.settingsMu.Unlock()
|
||||
if apply == nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "settings not wired"})
|
||||
|
||||
Reference in New Issue
Block a user