publishing in edit
This commit is contained in:
parent
42d960f185
commit
70902af7e0
|
@ -127,8 +127,10 @@ func (h *EditorHandler) HandlePostEdit(c *fiber.Ctx) error {
|
||||||
published := c.FormValue("action") == "Publish"
|
published := c.FormValue("action") == "Publish"
|
||||||
if !published {
|
if !published {
|
||||||
entry.SetPublishedAt(nil)
|
entry.SetPublishedAt(nil)
|
||||||
|
} else if entry.PublishedAt() == nil || entry.PublishedAt().IsZero() {
|
||||||
|
now := time.Now()
|
||||||
|
entry.SetPublishedAt(&now)
|
||||||
}
|
}
|
||||||
|
|
||||||
// update entry
|
// update entry
|
||||||
entry.SetMetaData(meta)
|
entry.SetMetaData(meta)
|
||||||
err = h.entrySvc.Update(entry)
|
err = h.entrySvc.Update(entry)
|
||||||
|
|
Loading…
Reference in New Issue