Fix Dialyzer opaque type warning in register_user_with_organization

- Create changeset before Multi pipeline for better type inference
- Pass changeset directly to Multi.insert instead of using function form
- Resolves call_without_opaque warning at line 97
This commit is contained in:
Graham McIntire 2026-01-03 12:41:28 -06:00
parent d345d7df30
commit 7cdb93ef31
No known key found for this signature in database

View file

@ -94,10 +94,10 @@ defmodule Towerops.Accounts do
"""
def register_user_with_organization(attrs) do
user_changeset = User.email_changeset(%User{}, attrs)
Ecto.Multi.new()
|> Ecto.Multi.insert(:user, fn _ ->
User.email_changeset(%User{}, attrs)
end)
|> Ecto.Multi.insert(:user, user_changeset)
|> Ecto.Multi.run(:organization, fn _repo, %{user: user} ->
org_name = attrs["organization_name"] || "Personal"