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:
parent
09736431e0
commit
caa4fbe326
1 changed files with 2 additions and 2 deletions
|
@ -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()}
|
||||
|
|
Loading…
Reference in a new issue