Update
This commit is contained in:
parent
8f63a831c4
commit
f963620cf0
11 changed files with 135 additions and 20 deletions
|
@ -6,12 +6,12 @@ defmodule NullaWeb.NoteController do
|
|||
|
||||
def show(conn, %{"username" => username, "id" => id}) do
|
||||
accept = List.first(get_req_header(conn, "accept"))
|
||||
note = Note.get_note!(id) |> Repo.preload([:user, :media_attachments])
|
||||
note = Note.get_note(id) |> Repo.preload([:actor, :media_attachments])
|
||||
|
||||
if username != note.user.username do
|
||||
if username != note.actor.preferredUsername do
|
||||
conn
|
||||
|> put_status(:not_found)
|
||||
|> json(%{error: "Note not found"})
|
||||
|> json(%{error: "Not Found"})
|
||||
|> halt()
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue