Make UserNote comment default to the empty string. #530
1 changed files with 1 additions and 1 deletions
Make UserNote comment default to the empty string.
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending
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
commit
d8bed0ff63
|
|
@ -31,7 +31,7 @@ defmodule Pleroma.UserNote do
|
|||
UserNote
|
||||
|> where(source_id: ^source.id, target_id: ^target.id)
|
||||
|> Repo.one() do
|
||||
note.comment
|
||||
note.comment || ""
|
||||
else
|
||||
_ -> ""
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue