mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: accept ids in code interfaces again
This commit is contained in:
parent
835187df49
commit
5b18e71738
2 changed files with 7 additions and 10 deletions
|
@ -798,11 +798,7 @@ defmodule Ash.CodeInterface do
|
|||
{:atomic, :stream, list}
|
||||
|
||||
other ->
|
||||
if Keyword.keyword?(other) || is_map(other) do
|
||||
{:atomic, :id, other}
|
||||
else
|
||||
{:atomic, :stream, other}
|
||||
end
|
||||
{:atomic, :id, other}
|
||||
end
|
||||
end
|
||||
else
|
||||
|
@ -1005,11 +1001,7 @@ defmodule Ash.CodeInterface do
|
|||
{:atomic, :stream, list}
|
||||
|
||||
other ->
|
||||
if Keyword.keyword?(other) || is_map(other) do
|
||||
{:atomic, :id, other}
|
||||
else
|
||||
{:atomic, :stream, other}
|
||||
end
|
||||
{:atomic, :id, other}
|
||||
end
|
||||
end
|
||||
else
|
||||
|
|
|
@ -303,6 +303,11 @@ defmodule Ash.Test.CodeInterfaceTest do
|
|||
assert %Ash.BulkResult{status: :success} = User.destroy!([bob3, bob4], context: @context)
|
||||
end
|
||||
|
||||
test "bulk destroy can take an id" do
|
||||
bob1 = User.create!("bob", context: @context)
|
||||
User.destroy!(bob1.id)
|
||||
end
|
||||
|
||||
test "bulk destroy can take an empty list" do
|
||||
assert %Ash.BulkResult{status: :success} = User.destroy([])
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue