add media-endpoint to config query

This commit is contained in:
Inhji 2023-07-17 19:39:03 +02:00
parent d9fd1bb08d
commit a16f93d4c3

View file

@ -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,8 +108,8 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
:ok ->
channels = Chiya.Channels.list_channels()
{:ok,
%{
config = %{
"media-endpoint" => url(~p"/indie/micropub/media"),
"destination" => [],
"post-types" => [
%{
@ -120,7 +124,9 @@ defmodule ChiyaWeb.Indie.MicropubHandler do
"name" => c.name
}
end)
}}
}
{:ok, config}
_ ->
{:error, :insufficient_scope}