user: avoid database work on superfluous pin

The only thing this does is changing the updated_at field of the user.
Afaict this came to be because prior to pins federating this was split
into two functions, one of which created a changeset, the other applying
a given changeset. When this was merged the bits were just copied into
place.
This commit is contained in:
Oneric 2024-12-17 00:14:27 +01:00
parent 09736431e0
commit caa4fbe326

View file

@ -2581,10 +2581,10 @@ def add_pinned_object_id(%User{} = user, object_id) do
[pinned_objects: "You have already pinned the maximum number of statuses"]
end
end)
|> update_and_set_cache()
else
change(user)
{:ok, user}
end
|> update_and_set_cache()
end
@spec remove_pinned_object_id(User.t(), String.t()) :: {:ok, t()} | {:error, term()}