From 83aac5527397ec198ec5102e6d91f9328f285ca0 Mon Sep 17 00:00:00 2001 From: Inhji Date: Mon, 10 Apr 2023 19:22:28 +0200 Subject: [PATCH] mix format --- lib/chiya/notes/note.ex | 2 +- lib/chiya/notes/references.ex | 1 - lib/chiya_web/controllers/note_controller.ex | 11 ++++++----- lib/chiya_web/controllers/note_html.ex | 6 ++---- lib/chiya_web/controllers/note_html/edit.html.heex | 7 ++++++- .../controllers/note_html/note_form.html.heex | 1 - 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/chiya/notes/note.ex b/lib/chiya/notes/note.ex index 6ce8c28..184a1c3 100644 --- a/lib/chiya/notes/note.ex +++ b/lib/chiya/notes/note.ex @@ -31,7 +31,7 @@ defmodule Chiya.Notes.Note do join_through: Chiya.Notes.NoteNote, join_keys: [source_id: :id, target_id: :id] - many_to_many :tags, Chiya.Tags.Tag, + many_to_many :tags, Chiya.Tags.Tag, join_through: Chiya.Notes.NoteTag, join_keys: [note_id: :id, tag_id: :id] diff --git a/lib/chiya/notes/references.ex b/lib/chiya/notes/references.ex index b0b686b..77e0e4c 100644 --- a/lib/chiya/notes/references.ex +++ b/lib/chiya/notes/references.ex @@ -128,7 +128,6 @@ defmodule Chiya.Notes.References do else Logger.debug("Note '#{slug}' does not exist anymore.") end - end) end diff --git a/lib/chiya_web/controllers/note_controller.ex b/lib/chiya_web/controllers/note_controller.ex index b00e9db..ec54f9a 100644 --- a/lib/chiya_web/controllers/note_controller.ex +++ b/lib/chiya_web/controllers/note_controller.ex @@ -75,11 +75,12 @@ defmodule ChiyaWeb.NoteController do |> redirect(to: ~p"/admin/notes/#{note}") {:error, %Ecto.Changeset{} = changeset} -> - render(conn, :edit, - note: note, - changeset: changeset, - channels: to_channel_options(), - tags: note.tags) + render(conn, :edit, + note: note, + changeset: changeset, + channels: to_channel_options(), + tags: note.tags + ) end end diff --git a/lib/chiya_web/controllers/note_html.ex b/lib/chiya_web/controllers/note_html.ex index 92c37de..41a00a4 100644 --- a/lib/chiya_web/controllers/note_html.ex +++ b/lib/chiya_web/controllers/note_html.ex @@ -13,9 +13,7 @@ defmodule ChiyaWeb.NoteHTML do def note_form(assigns) - def selected_channels(changeset), do: - Enum.map(changeset.data.channels, fn c -> c.id end) + def selected_channels(changeset), do: Enum.map(changeset.data.channels, fn c -> c.id end) - def tags_to_string(tags), do: - Enum.map_join(tags, ", ", fn t -> t.name end) + def tags_to_string(tags), do: Enum.map_join(tags, ", ", fn t -> t.name end) end diff --git a/lib/chiya_web/controllers/note_html/edit.html.heex b/lib/chiya_web/controllers/note_html/edit.html.heex index 1c80b92..88a556f 100644 --- a/lib/chiya_web/controllers/note_html/edit.html.heex +++ b/lib/chiya_web/controllers/note_html/edit.html.heex @@ -3,6 +3,11 @@ <:subtitle>Use this form to manage note records in your database. -<.note_form changeset={@changeset} action={~p"/admin/notes/#{@note}"} channels={@channels} tags={@tags} /> +<.note_form + changeset={@changeset} + action={~p"/admin/notes/#{@note}"} + channels={@channels} + tags={@tags} +/> <.back navigate={~p"/admin/notes"}>Back to notes diff --git a/lib/chiya_web/controllers/note_html/note_form.html.heex b/lib/chiya_web/controllers/note_html/note_form.html.heex index 13ab183..947e0cc 100644 --- a/lib/chiya_web/controllers/note_html/note_form.html.heex +++ b/lib/chiya_web/controllers/note_html/note_form.html.heex @@ -28,4 +28,3 @@ <.button>Save Note -