Files
pages/internal/server/api_recursive_preview.go
Anya Tokugawa c1175d389f Implement Knowledge City platform, organizer and DAV integration
Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
2026-09-27 14:44:43 +09:00

26 lines
705 B
Go

package server
import (
"encoding/json"
"net/http"
)
type renamePreviewResponse struct {
Targets []string `json:"targets"`
}
func (s *Server) handleRenamePreview(w http.ResponseWriter, r *http.Request) {
if !requirePathMutationPost(w, r) {
return
}
snapshot, err := s.authorizedMutationSnapshot(r, "rename", "", r.URL.Query().Get("old_path"), "", true)
if err != nil {
writePathMutationError(w, err)
return
}
// Return the checked set, not a fresh query that could reveal a newly added
// descendant for which the requester has never been authorized.
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(renamePreviewResponse{Targets: snapshot.Paths()})
}