 
   def handle_event("add_card", col_id, socket) do
     {:ok, %{card: new_card}} =
-      {:add_and_lock_card, col_id: col_id, user_id: socket.assigns.user.id}
+      {:add_and_lock_card, col_id: col_id, user_id: user_id(socket)}
       |> live_board_action(socket)
 
     {:noreply, presence_lock_card(socket, new_card)}

  @moduledoc "The LiveView for a Lucidboard"
  use Phoenix.LiveView
  alias Ecto.Changeset
  alias Lucidboard.{Account, Card, Column, LiveBoard, Presence, Twiddler, User}
  alias Lucidboard.Twiddler.Op
  alias LucidboardWeb.{BoardView, Endpoint}
  alias LucidboardWeb.Router.Helpers, as: Routes

  end

  def handle_event("like", card_id, socket) do
    live_board_action({:like, id: card_id, user: user(socket)}, socket)
    {:noreply, socket}
  end

