   (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)

    (let [new-board-slug (:board-slug entry-props) ; check if they are moving the entry
          new-board (when new-board-slug ; look up the board it's being moved to
                          (board-res/get-board conn (:org-uuid existing-entry) new-board-slug))
          new-board-uuid (:uuid new-board)
          props (if new-board-uuid
                  (assoc entry-props :board-uuid new-board-uuid)

      (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
    
