Sangres
Sangres
AEAsh Elixir
Created by Sangres on 1/18/2024 in #support
error with keyset pagination and random sort
yeah just read your response on the forum and on the issue that i submitted regarding the after_action. Thank you so much ❤️
8 replies
AEAsh Elixir
Created by Sangres on 1/18/2024 in #support
error with keyset pagination and random sort
10:24:47.942 [error] Task #PID<0.6631.0> started from #PID<0.6616.0> terminating
** (Ash.Error.Unknown) Unknown Error

Context: resolving data on fetch MyApp.Post.list
* Context: resolving data on fetch MyApp.Post.list

** (UndefinedFunctionError) function nil.cast_in_query?/1 is undefined
nil.cast_in_query?([])
(elixir 1.15.0) lib/enum.ex:2585: anonymous fn/3 in Enum.reject/2
(stdlib 5.0) maps.erl:416: :maps.fold_1/4
(elixir 1.15.0) lib/enum.ex:2522: Enum.reject/2
(ash 2.17.20) lib/ash/actions/helpers.ex:391: Ash.Actions.Helpers.load_runtime_types/3
(ash 2.17.20) lib/ash/actions/read/read.ex:1486: anonymous fn/4 in Ash.Actions.Read.data_field/3
(ash 2.17.20) lib/ash/engine/request.ex:1140: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.17.20) lib/ash/engine/request.ex:284: Ash.Engine.Request.do_next/1
(ash 2.17.20) lib/ash/engine/request.ex:213: Ash.Engine.Request.next/1
(ash 2.17.20) lib/ash/engine/engine.ex:712: Ash.Engine.advance_request/2
(ash 2.17.20) lib/ash/engine/engine.ex:637: Ash.Engine.fully_advance_request/2
(ash 2.17.20) lib/ash/engine/engine.ex:578: Ash.Engine.do_run_iteration/2
(elixir 1.15.0) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
(ash 2.17.20) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.17.20) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.17.20) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:378: Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:363: anonymous fn/5 in Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:378: Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:363: anonymous fn/5 in Ash.DataLayer.transaction/4
10:24:47.942 [error] Task #PID<0.6631.0> started from #PID<0.6616.0> terminating
** (Ash.Error.Unknown) Unknown Error

Context: resolving data on fetch MyApp.Post.list
* Context: resolving data on fetch MyApp.Post.list

** (UndefinedFunctionError) function nil.cast_in_query?/1 is undefined
nil.cast_in_query?([])
(elixir 1.15.0) lib/enum.ex:2585: anonymous fn/3 in Enum.reject/2
(stdlib 5.0) maps.erl:416: :maps.fold_1/4
(elixir 1.15.0) lib/enum.ex:2522: Enum.reject/2
(ash 2.17.20) lib/ash/actions/helpers.ex:391: Ash.Actions.Helpers.load_runtime_types/3
(ash 2.17.20) lib/ash/actions/read/read.ex:1486: anonymous fn/4 in Ash.Actions.Read.data_field/3
(ash 2.17.20) lib/ash/engine/request.ex:1140: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.17.20) lib/ash/engine/request.ex:284: Ash.Engine.Request.do_next/1
(ash 2.17.20) lib/ash/engine/request.ex:213: Ash.Engine.Request.next/1
(ash 2.17.20) lib/ash/engine/engine.ex:712: Ash.Engine.advance_request/2
(ash 2.17.20) lib/ash/engine/engine.ex:637: Ash.Engine.fully_advance_request/2
(ash 2.17.20) lib/ash/engine/engine.ex:578: Ash.Engine.do_run_iteration/2
(elixir 1.15.0) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
(ash 2.17.20) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.17.20) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.17.20) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:378: Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:363: anonymous fn/5 in Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:378: Ash.DataLayer.transaction/4
(ash 2.17.20) lib/ash/data_layer/data_layer.ex:363: anonymous fn/5 in Ash.DataLayer.transaction/4
8 replies
AEAsh Elixir
Created by Sangres on 9/4/2023 in #support
set action argument in form
no worries 😄
16 replies
AEAsh Elixir
Created by Sangres on 9/4/2023 in #support
set action argument in form
unfortunately i can't manage to make it work. I know that probably there's something im missing on my side. I have now changed the structure of the app to make an user unrelated to the account and now it's working. Thanks a lot for all the info nonetheless ❤️
16 replies
AEAsh Elixir
Created by Sangres on 9/4/2023 in #support
set action argument in form
Unfortunately i tried using before_action and before_transaction but its not working. Could the problem be caused by the fact that account is the resource that manages the multi tenancy in my app?
16 replies
AEAsh Elixir
Created by Sangres on 9/4/2023 in #support
set action argument in form
in the action i have something like this
argument :account_id, AshUUID.UUID, allow_nil?: false
change manage_relationship(:account_id, :account, type: :append_and_remove)
argument :account_id, AshUUID.UUID, allow_nil?: false
change manage_relationship(:account_id, :account, type: :append_and_remove)
While in the submit i have this
account = Core.Account.create!()

case AshPhoenix.Form.submit(form, before_submit: fn changeset ->
Ash.Changeset.set_argument(changeset, :account_id, account.id)
end) do
...
end
account = Core.Account.create!()

case AshPhoenix.Form.submit(form, before_submit: fn changeset ->
Ash.Changeset.set_argument(changeset, :account_id, account.id)
end) do
...
end
16 replies