Merge pull request 'wip of source query' (#262) from devel into main
Reviewed-on: #262
This commit is contained in:
commit
c26bf4cc46
2 changed files with 8 additions and 1 deletions
|
@ -83,6 +83,13 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
||||||
with :ok <- Micropub.verify_token(access_token),
|
with :ok <- Micropub.verify_token(access_token),
|
||||||
{:ok, slug} <- Chiya.Notes.Note.note_slug(url),
|
{:ok, slug} <- Chiya.Notes.Note.note_slug(url),
|
||||||
note <- Chiya.Notes.get_public_note_by_slug_preloaded!(slug) do
|
note <- Chiya.Notes.get_public_note_by_slug_preloaded!(slug) do
|
||||||
|
properties = %{
|
||||||
|
"name" => [note.name],
|
||||||
|
"content" => [note.content],
|
||||||
|
"category" => Enum.map(note.tags, fn tag -> tag.name end),
|
||||||
|
"published" => note.published_at
|
||||||
|
}
|
||||||
|
|
||||||
filtered_note =
|
filtered_note =
|
||||||
Map.filter(note, fn {key, _val} ->
|
Map.filter(note, fn {key, _val} ->
|
||||||
Enum.member?(filter_properties, to_string(key))
|
Enum.member?(filter_properties, to_string(key))
|
||||||
|
|
Loading…
Reference in a new issue