Set published when empty
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-10-31 23:08:43 +01:00
parent dc56e09914
commit 903a9999c0
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -67,6 +67,10 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), 400)
return
}
log.Printf("Item published: %s", item.Published)
if item.Published == "" {
item.Published = time.Now().Format(time.RFC3339)
}
item.Read = false
newID, err := generateItemID(conn, channel)