Browse Source

fix: preload daily note

main
Inhji Y. 3 months ago
parent
commit
1aee17f764
  1. 5
      lib/mirage/notes.ex

5
lib/mirage/notes.ex

@ -124,13 +124,12 @@ defmodule Mirage.Notes do
where: n.title == ^date_title,
select: n
case Repo.one(q) do
note = case Repo.one(q) do
%Note{} = note ->
[note]
nil ->
template = Mirage.Settings.get_setting_by_name!("daily_template")
IO.inspect(template)
{:ok, note} =
create_note(%{
@ -140,6 +139,8 @@ defmodule Mirage.Notes do
[note]
end
note |> preload_note()
end
def today_title() do

Loading…
Cancel
Save