Update tests
This commit is contained in:
parent
406cd1798c
commit
c30541830f
10 changed files with 134 additions and 284 deletions
|
@ -7,7 +7,7 @@ defmodule NullaWeb.NoteController do
|
|||
def show(conn, %{"username" => username, "id" => id}) do
|
||||
case Integer.parse(id) do
|
||||
{int_id, ""} ->
|
||||
note = Note.get_note(int_id) |> Repo.preload([:actor, :media_attachments])
|
||||
note = Note.get_note(id: int_id) |> Repo.preload([:actor, :media_attachments])
|
||||
|
||||
cond do
|
||||
is_nil(note) ->
|
||||
|
@ -23,9 +23,9 @@ defmodule NullaWeb.NoteController do
|
|||
|> halt()
|
||||
|
||||
true ->
|
||||
accept = List.first(get_req_header(conn, "accept"))
|
||||
format = Phoenix.Controller.get_format(conn)
|
||||
|
||||
if accept in ["application/activity+json", "application/ld+json"] do
|
||||
if format == "activity+json" do
|
||||
conn
|
||||
|> put_resp_content_type("application/activity+json")
|
||||
|> json(ActivityPub.note(note))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue