defmodule ToweropsWeb.OrgLive.Index do
  @moduledoc false
  use ToweropsWeb, :live_view

  alias Towerops.Organizations

  @impl true
  def mount(_params, _session, socket) do
    user = socket.assigns.current_scope.user
    organizations = Organizations.list_user_organizations(user.id)

    {:ok,
     socket
     |> assign(:page_title, "Your Organizations")
     |> assign(:organizations, organizations)}
  end

  @impl true
  def handle_params(_params, _url, socket) do
    {:noreply, socket}
  end
end
