1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Provide space add/remove event notifications

This commit is contained in:
sauls8t 2018-02-22 18:13:56 +00:00
parent c705e8c299
commit 8d4c6a19ee
2 changed files with 12 additions and 1 deletions

View file

@ -22,6 +22,7 @@ import (
"strings"
"github.com/documize/community/core/env"
"github.com/documize/community/core/event"
"github.com/documize/community/core/request"
"github.com/documize/community/core/response"
"github.com/documize/community/core/secrets"
@ -295,6 +296,8 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
ctx.Transaction.Commit()
}
event.Handler().Publish(string(event.TypeAddSpace))
response.WriteJSON(w, sp)
}
@ -510,6 +513,8 @@ func (h *Handler) Remove(w http.ResponseWriter, r *http.Request) {
h.Store.Audit.Record(ctx, audit.EventTypeSpaceDelete)
event.Handler().Publish(string(event.TypeRemoveSpace))
response.WriteEmpty(w)
}
@ -596,6 +601,8 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request) {
h.Store.Audit.Record(ctx, audit.EventTypeSpaceDelete)
event.Handler().Publish(string(event.TypeRemoveSpace))
response.WriteEmpty(w)
}