You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result = Ash.Resource.put_metadata(result, :signed_url, url)
But unfortunately this did not result in filling this field in the meta field of the returned resource data.
Would be convenient for certain use cases to be able to pass additional data this way. I'm for example generating a signed url with write permissions for a storage bucket on creation of a resource. I only want to return this after creation. On reads I may want a read-only url.
@zachdanielsuggested to use the metadata option on the route instead of the action instead, or use a calculated field. A combination of both options would do the job for me (action metadata for write-enabled url, calculated field for read-only url), but if I add a graphql api as well I've got to declare metadata for create there again, which this feature would prevent.
Also, for batch create actions, I think it makes sense to have this metadata per resource instead of on the route.
Curious for options on this :)
The text was updated successfully, but these errors were encountered:
Feature request
I tried to return an additional field for my resource by adding a
metadata
option to mycreate
action like this:And setting this value in a
change
using:But unfortunately this did not result in filling this field in the
meta
field of the returned resource data.Would be convenient for certain use cases to be able to pass additional data this way. I'm for example generating a signed url with write permissions for a storage bucket on creation of a resource. I only want to return this after creation. On reads I may want a read-only url.
@zachdaniel suggested to use the
metadata
option on the route instead of the action instead, or use a calculated field. A combination of both options would do the job for me (action metadata for write-enabled url, calculated field for read-only url), but if I add a graphql api as well I've got to declare metadata for create there again, which this feature would prevent.Also, for batch create actions, I think it makes sense to have this metadata per resource instead of on the route.
Curious for options on this :)
The text was updated successfully, but these errors were encountered: