mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: handle small logic error in notification sending for bulk actions
This commit is contained in:
parent
26871fa552
commit
93ae8f17a5
2 changed files with 18 additions and 10 deletions
|
@ -427,14 +427,18 @@ defmodule Ash.Actions.Destroy.Bulk do
|
|||
{Enum.reverse(errors), Enum.reverse(successes), notifications, error_count}
|
||||
end)
|
||||
else
|
||||
{[], results, [], 0}
|
||||
{[], results || [], [], 0}
|
||||
end
|
||||
|
||||
notifications =
|
||||
notifications ++
|
||||
Enum.map(results, fn result ->
|
||||
notification(atomic_changeset, result, opts)
|
||||
end)
|
||||
if opts[:notify?] do
|
||||
notifications ++
|
||||
Enum.map(results, fn result ->
|
||||
notification(atomic_changeset, result, opts)
|
||||
end)
|
||||
else
|
||||
notifications
|
||||
end
|
||||
|
||||
status =
|
||||
case {error_count, results} do
|
||||
|
|
|
@ -384,7 +384,7 @@ defmodule Ash.Actions.Update.Bulk do
|
|||
{Enum.reverse(errors), Enum.reverse(successes), notifications, error_count}
|
||||
end)
|
||||
else
|
||||
{[], results, [], 0}
|
||||
{[], results || [], [], 0}
|
||||
end
|
||||
|
||||
{results, errors, error_count} =
|
||||
|
@ -403,10 +403,14 @@ defmodule Ash.Actions.Update.Bulk do
|
|||
end
|
||||
|
||||
notifications =
|
||||
notifications ++
|
||||
Enum.map(results, fn result ->
|
||||
notification(atomic_changeset, result, opts)
|
||||
end)
|
||||
if opts[:notify?] do
|
||||
notifications ++
|
||||
Enum.map(results, fn result ->
|
||||
notification(atomic_changeset, result, opts)
|
||||
end)
|
||||
else
|
||||
notifications
|
||||
end
|
||||
|
||||
status =
|
||||
case {error_count, results} do
|
||||
|
|
Loading…
Reference in a new issue