Skip to content

Commit 91cb26d

Browse files
committed
chore: properly set fields on request
1 parent 4eaa372 commit 91cb26d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/ash_json_api/request.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,13 @@ defmodule AshJsonApi.Request do
462462
|> Ash.Domain.Info.resources()
463463
|> Enum.find(&(AshJsonApi.Resource.Info.type(&1) == type))
464464
end)
465+
|> then(fn
466+
nil ->
467+
add_error(request, InvalidType.exception(type: type), request.route.type)
468+
469+
resource ->
470+
add_fields(request, resource, fields, true)
471+
end)
465472
end
466473

467474
resource ->

0 commit comments

Comments
 (0)