Ash FrameworkAF
Ash Frameworkβ€’4mo agoβ€’
43 replies
Shahryar

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 and have access to everything), and the other group being regular users (who do have a 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.


Code: https://gist.github.com/shahryarjb/0be03b650741abfbeb7cce0678a38ea5

It is related to https://discord.com/channels/711271361523351632/1019647368196534283/threads/1425967219036393582 But since it was a general issue, I separated it."


By the way, every where i face this issue i am forced to create separate calculate πŸ₯΄πŸ˜΅β€πŸ’«πŸ₯²
Solution
its not much money but we aren't loaded πŸ˜†
Was this page helpful?