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.
26 lines
705 B
Go
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()})
|
|
}
|