Merge pull request 'devel' (#211) from devel into main
Reviewed-on: #211
This commit is contained in:
commit
e4a1eb39c5
1 changed files with 23 additions and 17 deletions
|
@ -2,6 +2,10 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
|||
@behaviour PlugMicropub.HandlerBehaviour
|
||||
require Logger
|
||||
|
||||
use Phoenix.VerifiedRoutes,
|
||||
endpoint: ChiyaWeb.Endpoint,
|
||||
router: ChiyaWeb.Router
|
||||
|
||||
alias ChiyaWeb.Indie.Properties, as: Props
|
||||
alias ChiyaWeb.Indie.Token
|
||||
|
||||
|
@ -104,23 +108,25 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
|
|||
:ok ->
|
||||
channels = Chiya.Channels.list_channels()
|
||||
|
||||
{:ok,
|
||||
%{
|
||||
"destination" => [],
|
||||
"post-types" => [
|
||||
%{
|
||||
"type" => "note",
|
||||
"name" => "Note"
|
||||
}
|
||||
],
|
||||
"channels" =>
|
||||
Enum.map(channels, fn c ->
|
||||
%{
|
||||
"uid" => c.slug,
|
||||
"name" => c.name
|
||||
}
|
||||
end)
|
||||
}}
|
||||
config = %{
|
||||
"media-endpoint" => url(~p"/indie/micropub/media"),
|
||||
"destination" => [],
|
||||
"post-types" => [
|
||||
%{
|
||||
"type" => "note",
|
||||
"name" => "Note"
|
||||
}
|
||||
],
|
||||
"channels" =>
|
||||
Enum.map(channels, fn c ->
|
||||
%{
|
||||
"uid" => c.slug,
|
||||
"name" => c.name
|
||||
}
|
||||
end)
|
||||
}
|
||||
|
||||
{:ok, config}
|
||||
|
||||
_ ->
|
||||
{:error, :insufficient_scope}
|
||||
|
|
Loading…
Reference in a new issue