Allow direct access to draft and scheduled posts by slug

This commit is contained in:
Willem van den Ende
2026-04-01 20:39:19 +00:00
parent 370275f7b5
commit 20f12847d6
5 changed files with 23 additions and 11 deletions
+2 -2
View File
@@ -78,12 +78,12 @@ defmodule Blogex.Test.FakeBlog do
end
def get_post!(id) do
Enum.find(all_posts(), &(&1.id == id)) ||
Enum.find(unfiltered_posts(), &(&1.id == id)) ||
raise Blogex.NotFoundError, "post #{inspect(id)} not found"
end
def get_post(id) do
Enum.find(all_posts(), &(&1.id == id))
Enum.find(unfiltered_posts(), &(&1.id == id))
end
def paginate(page \\ 1, per_page \\ 10) do