Fix credo style reports following it's update

Mainly transform `with` into `case`

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-23 18:06:22 +02:00
parent 1cd511f440
commit c3cca5d613
26 changed files with 303 additions and 248 deletions

View File

@@ -235,8 +235,9 @@ defmodule Mobilizon.Users do
end
def update_user_default_actor(user_id, actor_id) do
with from(u in User, where: u.id == ^user_id, update: [set: [default_actor_id: ^actor_id]])
|> Repo.update_all([]) do
with _ <-
from(u in User, where: u.id == ^user_id, update: [set: [default_actor_id: ^actor_id]])
|> Repo.update_all([]) do
Repo.get!(User, user_id) |> Repo.preload([:default_actor])
end
end