       (if (lib-schema/valid? common-res/Entry updated-entry)
         {:existing-entry existing-entry
          :existing-board new-board
+         :moving-board old-board
          :updated-entry updated-entry}
         [false, {:updated-entry updated-entry}])) ; invalid update
     

            _delete-result (entry-res/delete-entry! conn (:uuid entry))]
    (do
      ;; If deleting a draft on a draft board
      (when (and (= (keyword (:status entry)) :draft) (:draft board))
        ;; check how many entries the section still have
        (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid board))]
          ;; if we are deleting the last draft
          (when (zero? (count remaining-entries))
            (timbre/info "Deleting board:" (:uuid board) "because last draft was removed.")
            ;; Remove also the board
            (board-res/delete-board! conn (:uuid board) remaining-entries)
            (timbre/info "Deleted board:" (:uuid board))
            (notification/send-trigger! (notification/->trigger :delete org {:old board} (:user ctx))))))
      (timbre/info "Deleted entry for:" entry-for)
      (notification/send-trigger! (notification/->trigger :delete org board {:old entry} (:user ctx) nil))
      true)

  (if-let* [user (:user ctx)
            org (:existing-org ctx)
            board (:existing-board ctx)
            old-board (:moving-board ctx)
            entry (:existing-entry ctx)
            updated-entry (:updated-entry ctx)
            publish-result (entry-res/publish-entry! conn (:uuid updated-entry) updated-entry user)]
    (do
      (undraft-board conn user org board)
      ;; If we are moving the entry from a draft board, check if we need to remove the board itself.
      (when old-board
        (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid old-board))]
          (board-res/maybe-delete-draft-board conn org old-board remaining-entries user)))
      (timbre/info "Published entry for:" (:uuid updated-entry))
      (auto-share-on-publish conn ctx publish-result)
      (timbre/info "Published entry:" entry-for)
