mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-08 17:34:19 +00:00
Make UserNote comment default to the empty string.
This make the behavior consistent between when UserNote doesn't exist and when comment is null. The current behavior may return null in APIs, which misleads some clients doing feature detection into thinking the server does not support comments. For example, see https://codeberg.org/husky/husky/issues/92
This commit is contained in:
parent
b86b3a9e29
commit
d8bed0ff63
|
@ -31,7 +31,7 @@ defmodule Pleroma.UserNote do
|
||||||
UserNote
|
UserNote
|
||||||
|> where(source_id: ^source.id, target_id: ^target.id)
|
|> where(source_id: ^source.id, target_id: ^target.id)
|
||||||
|> Repo.one() do
|
|> Repo.one() do
|
||||||
note.comment
|
note.comment || ""
|
||||||
else
|
else
|
||||||
_ -> ""
|
_ -> ""
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue