Showing paginated data inside generic actions, works in normal call but i can not show in json
Hi my friends,
Since my application's structure includes two types of users — one group being masters(who don't have a
site_id
site_id
and have access to everything), and the other group being regular users (who do have a
site_id
site_id
and can only access their own data) — this setup has led to a few challenges for me.
The main issue I'm facing due to this structure is that I often need to create generic actions. Unfortunately, I'm running into two major problems with this approach:
1. I'm ending up writing a lot of repetitive code and running extra queries, which I feel defeats the purpose of using Ash in the first place. 2. Another issue is that, for example, in the code below I can’t display media and its pagination properly in the JSON response when using generic actions — even though everything works fine in a normal call.
This problem is recurring throughout my entire application.
If you have any suggestions or guidance, I would really appreciate it. Thanks in advance.
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.