mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Provider foundation for doc lifecycle and versions
This commit is contained in:
parent
4e32bffebe
commit
958f4d30b9
19 changed files with 918 additions and 782 deletions
|
@ -35,6 +35,7 @@ import (
|
|||
"github.com/documize/community/model/page"
|
||||
pm "github.com/documize/community/model/permission"
|
||||
"github.com/documize/community/model/template"
|
||||
"github.com/documize/community/model/workflow"
|
||||
uuid "github.com/nu7hatch/gouuid"
|
||||
)
|
||||
|
||||
|
@ -377,7 +378,12 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
|
|||
event.Handler().Publish(string(event.TypeAddDocument), nd.Title)
|
||||
|
||||
a, _ := h.Store.Attachment.GetAttachments(ctx, documentID)
|
||||
go h.Indexer.IndexDocument(ctx, nd, a)
|
||||
|
||||
if nd.Lifecycle == workflow.LifecycleLive {
|
||||
go h.Indexer.IndexDocument(ctx, nd, a)
|
||||
} else {
|
||||
go h.Indexer.DeleteDocument(ctx, d.RefID)
|
||||
}
|
||||
|
||||
response.WriteJSON(w, nd)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue