This commit is contained in:
Mirai Kumiko 2025-06-19 16:16:27 +02:00
parent 8f63a831c4
commit f963620cf0
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
11 changed files with 135 additions and 20 deletions

View file

@ -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