aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/server.go')
-rw-r--r--internal/admin/server.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/admin/server.go b/internal/admin/server.go
index 8fcba77..800cfa1 100644
--- a/internal/admin/server.go
+++ b/internal/admin/server.go
@@ -908,6 +908,10 @@ func (s *AdminServer) doUndo(w http.ResponseWriter, r *http.Request) {
}
change := s.undoStack.Undo()
if change == nil {
+ if err := s.undoStack.LastError(); err != nil {
+ writeJSONError(w, "undo failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
writeJSON(w, map[string]any{"message": "Nothing to undo"})
return
}
@@ -927,6 +931,10 @@ func (s *AdminServer) doRedo(w http.ResponseWriter, r *http.Request) {
}
change := s.undoStack.Redo()
if change == nil {
+ if err := s.undoStack.LastError(); err != nil {
+ writeJSONError(w, "redo failed: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
writeJSON(w, map[string]any{"message": "Nothing to redo"})
return
}