fix: validate account on mapping PUT; gate folders btn during run; prune stale mapping keys; drop dead export

This commit is contained in:
2026-07-03 12:08:22 +07:00
parent 964e4cfc33
commit b59ce67497
4 changed files with 11 additions and 5 deletions
+9
View File
@@ -228,11 +228,20 @@ func (s *Server) handleProbeAccountFolders(w http.ResponseWriter, r *http.Reques
// handleSetAccountFolderMapping persists one account's rename map + excluded set.
func (s *Server) handleSetAccountFolderMapping(w http.ResponseWriter, r *http.Request) {
taskID, err := pathID(r, "id")
if err != nil {
http.Error(w, "bad id", http.StatusBadRequest)
return
}
accID, err := pathID(r, "accountId")
if err != nil {
http.Error(w, "bad account id", http.StatusBadRequest)
return
}
if _, ok := s.findAccount(r, taskID, accID); !ok {
http.Error(w, "account not found", http.StatusNotFound)
return
}
var body struct {
Mapping map[string]string `json:"mapping"`
Excluded []string `json:"excluded"`