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

Set document lifecycle defaults

This commit is contained in:
Harvey Kandola 2018-03-20 14:17:11 +00:00
parent d9a2b16c2a
commit 297ce94546
4 changed files with 22 additions and 3 deletions

View file

@ -142,6 +142,7 @@ func (h *Handler) SaveAs(w http.ResponseWriter, r *http.Request) {
doc.RefID = docID
doc.ID = 0
doc.Template = true
doc.Lifecycle = workflow.LifecycleLive
// Duplicate pages and associated meta
pages, err := h.Store.Page.GetPages(ctx, model.DocumentID)
@ -307,6 +308,7 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
d.LabelID = folderID
d.UserID = ctx.UserID
d.Title = docTitle
d.Lifecycle = workflow.LifecycleLive
err = h.Store.Document.Add(ctx, d)
if err != nil {