From 5cef58eeba4d703fce411fb067b4bbb90a3391c1 Mon Sep 17 00:00:00 2001 From: HarveyKandola Date: Tue, 24 Sep 2019 14:07:44 +0100 Subject: [PATCH] Re-sync space counts when moving docs Between spaces! --- domain/document/endpoint.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/domain/document/endpoint.go b/domain/document/endpoint.go index 1c8f7fef..64a68730 100644 --- a/domain/document/endpoint.go +++ b/domain/document/endpoint.go @@ -312,6 +312,9 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) { ctx.Transaction.Commit() h.Store.Space.SetStats(ctx, d.SpaceID) + if oldDoc.SpaceID != d.SpaceID { + h.Store.Space.SetStats(ctx, oldDoc.SpaceID) + } h.Store.Audit.Record(ctx, audit.EventTypeDocumentUpdate) // Live document indexed for search.