Is there a way to get file URLs in initial query of items? #2769
holmesadrianh
announced in
Archive
Replies: 1 comment 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure if I am missing something, but I am noticing that my web application requires quite a few server requests when it comes to retrieving image URLs. If I request a number of items, each with an image, I then have to send a request to the server for each image ID just to get the image URL. Is there a way to have the image URL included directly in the first request?
For example, I first request items:
URL: {{Directus URL}}/items/media
Return data:
Then I have to request the image data to get the image URL:
URL: {{Directus URL}}/files/43
Return data:
No the issue comes in is when I have 100 items in the initial request. I have to them request an image for every item. There is a clear delay in the loading of the page.
Is there a was to access the image URL from the initial query? Is there a way to include the image data instead of just the ID? Or at the very least the URL to the image itself?
Beta Was this translation helpful? Give feedback.
All reactions