diff --git a/lib/app/item.ex b/lib/app/item.ex index f99b3017..b1edcda7 100644 --- a/lib/app/item.ex +++ b/lib/app/item.ex @@ -190,17 +190,6 @@ defmodule App.Item do |> Repo.update() end - # defp reorder_list_to_add_item(%Item{position: position}) do - # # Increments the positions above a given position. - # # We are making space for the item to be added. - - # from(i in Item, - # where: i.position > ^position, - # update: [inc: [position: 1]] - # ) - # |> Repo.update_all([]) - # end - def all_items_for_person(person_id) do Item |> where(person_id: ^person_id) @@ -226,9 +215,8 @@ defmodule App.Item do # def items_with_timers(person_id \\ 0) do all_list = App.List.get_all_list_for_person(person_id) - # dbg(all_list) seq = App.List.get_list_seq(all_list) - # dbg(seq) + sql = """ SELECT i.id, i.cid, i.text, i.status, i.person_id, i.updated_at, diff --git a/lib/app/list.ex b/lib/app/list.ex index 454c0238..dd1193be 100644 --- a/lib/app/list.ex +++ b/lib/app/list.ex @@ -134,7 +134,6 @@ defmodule App.List do def get_all_list_for_person(person_id) do # IO.inspect("get_all_list_for_person(person_id: #{person_id})") all_list = get_list_by_name!("all", person_id) - # dbg(all_list) if all_list == nil do # doesn't exist, create it: {:ok, %{model: list}} = @@ -148,10 +147,8 @@ defmodule App.List do def add_item_to_list(item_cid, list_cid, person_id) do list = get_list_by_cid!(list_cid) - # dbg(list) prev_seq = get_list_seq(list) seq = [item_cid | prev_seq] |> Enum.join(",") - # dbg(seq) update_list(list, %{seq: seq, person_id: person_id}) end @@ -194,11 +191,8 @@ defmodule App.List do """ def add_all_items_to_all_list_for_person_id(person_id) do all_list = App.List.get_all_list_for_person(person_id) - # dbg(all_list) all_items = App.Item.all_items_for_person(person_id) - # dbg(all_items) prev_seq = get_list_seq(all_list) - # dbg(prev_seq) # Add add each `item.id` to the sequence of item ids: seq = Enum.reduce(all_items, prev_seq, fn i, acc -> diff --git a/lib/app_web/live/app_live.ex b/lib/app_web/live/app_live.ex index 1fc55c1d..acf34a4f 100644 --- a/lib/app_web/live/app_live.ex +++ b/lib/app_web/live/app_live.ex @@ -289,7 +289,6 @@ defmodule AppWeb.AppLive do }, socket ) do - # IO.puts("285: current_item_id: #{current_item_id}, selected_item_id: #{selected_item_id} | #{Useful.typeof(selected_item_id)}") AppWeb.Endpoint.broadcast( @topic, "move_items", @@ -319,9 +318,6 @@ defmodule AppWeb.AppLive do }, socket ) do - # IO.puts( - # "cur_item_id: #{current_item_id}, selected_item_id: #{selected_item_id}" - # ) {:noreply, push_event(socket, "dragover-item", %{