Expected at most one result but got ...
I'm not sure if I've encountered a bug or not.
I have the following action:
and the following associated code interface:
I expect it to return at most one result.
In iex, if I call the following:
I receive the following error:
I confirmed that my record exists and that there is only one in my DB. More interestingly, here's the query that's being performed:
I only see a check for the tenant here (airline_id) and not the id of the flight.
Am I missing something super obvious in my resource or is this a bug?
Thanks a lot it in advance! 😀
3 Replies
adding the argument doesn't apply a filter to the read action
You likely want something like this in the read action:
Of course 🤦🏼♂️ thanks!
@richaard0 you can also do the following, which will define the filter on the
read
action for you, and return a single record instead of a list: