From 79764732406d6484f67d3dec045483dcb5d08c28 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 20:03:13 -0400 Subject: feat: better card ascii art --- internal/admin/api_techs.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'internal/admin/api_techs.go') diff --git a/internal/admin/api_techs.go b/internal/admin/api_techs.go index 9e742e1..d2c5f65 100644 --- a/internal/admin/api_techs.go +++ b/internal/admin/api_techs.go @@ -111,9 +111,16 @@ func (s *AdminServer) handleTechByID(w http.ResponseWriter, r *http.Request) { var oldContent []byte if !isCreate { - if existing, err := snapshotFile(path); err == nil { - oldContent = existing + existing, existed, err := snapshotBefore(path) + if err != nil { + failJSON(w, "read existing file: "+err.Error()) + return } + if !existed { + failJSON(w, "not found: "+id) + return + } + oldContent = existing } newContent, err := writeMapAsYAML(path, body) -- cgit v1.2.3