sisk
AEAsh Elixir
•Created by sisk on 5/16/2023 in #support
Query
how do i translate this code for example
Helpdesk.Support.Ticket|> Ash.Query.filter(contains(subject, "2"))
into the resource's read action. Basically as part of my read action I want to filter with something similar to SQL like. i can do it on iex. but not sure how to intergrate into read action for my api.? i want to know how to use the contains(subject, "2")
inside the read action?3 replies
AEAsh Elixir
•Created by sisk on 5/15/2023 in #support
Date time
say i want to create a resource via json api post request that has an attribute of type :utc_datetime_usec, since the value is received as a string how can i convert the string to DateTime inside the create action of the resource, i assumed there is auto cast, however it seem to not work?
6 replies
AEAsh Elixir
•Created by sisk on 5/10/2023 in #support
Json Api
Say I have two resources user and profile. relationship being profile belongs to user. when iam returning user resource how can i return it along with the profile as response from get request?. i have a read action that works well and return data as expected via iex. however if i use the same action on json api, i only recieve user data without profile data. can someone guide me?
4 replies