Closed PhilipZi closed 8 months ago
Hi @PhilipZi, Can you send a link to a repo or Stackblitz to make it easier for us to help you? What version of the module are you using 5.x or 6.x?
Btw, a query like this: "..." will use a lot of resources; I would highly discourage wildcard usage, even if you use Directus+Postgress, and particularly if you use other DB.
Hey Matt, thanks for the quick reply! Its on gitlab and i cant really share the repo unfortunately.
i am using 1.3 anyhow? If you mean the nuxt-directus lib? I can provide you more code snippets if this helps? What you saw earlier is a snippet from a pinia store. It works as it is shown the only thing i need is to reach the folder and the collections inside that folder which is nested in one collection. It would also help if i can just reach collections inside of folders.
actually i am using 5.6 xD i screen shot the wrong dep.
I also set the public accessibility for directus_folders and directus_collections to visibile/readable
If I understand correctly the folders
endpoint they are meant for files and not collections. Official docs:
Folders can be used to organize files within the platform. Folders are virtual, and aren't mirrored within the storage adapter.
But in your screenshot above:
It seems like you are referring to folders
for collections and not files? If this is the case I'm not sure if they can be used in the API/SDK or they are just a visual representation of the Directus app
thanks Sandros, this is actually correct, but when i speak to the support_portal collection for example i wont be able to reach block_hero_banner, its not shown in the api even if i put away the folder. You got me right there. This is my main issue. later on i wanna have multiple collections inside support_portal which i would like to generate with one request if possible.
To make it more clear is there a build in function to reach the folders content? It seams via @directus/sdk lib i could reach these? See my sceenshot.
here it seems to be possible to reach the folders. but in nuxt-directus this option is not documented or working. I need to use nuxt-directus lib because with the other lib nuxt-images wont get rendered in webp format...
would be happy if someone can help out.
Yes, but that is the virtual folder that Directus uses; it's just a table in the DB called directus_folders.
In any case, you can't use readFolders
for a folder table that you created; it works only with Directus own folder system.
If you want to use the SDK, you could try the 6.x version of the module that is in development and directly works with the SDK, but version 5.x is based on Directus API non SDK:
Also, as @casualmatt mentioned, the 6.x currently available in pre-release under nuxt-directus-next
already has support for @directus/sdk
and @nuxt/image
.
Again, the folders you are mentioning (in /admin/settings/data-model
if your Directus App), as far as I remember, aren't the folders under the readFolders
composable from the SDK. Did you double check your permissions for the block_hero_banner
collection, and have a valid relation from support_portal
and a junction M2A
collection (that is missing from the information provided so far)?
Please refer to the official docs on how to build reusable page components. If you are going to use nuxt-directud-next
you can also use clients (our docs about the SDK are still being drafted).
@PhilipZi We are not able to reproduce your issue/request. For now, I will close the issue as "Not planned/stale". If, in the future, you are able to provide a Stackblitz link, we will go over it again and try to help you.
Thanks a lot guys i understand now. I found a way around. Much appreciate you help.
the library wont let me retrieve my folders from directus.
see my code:
This is my code to reach a collection called support portal. This works. But i cant reach folders inside this collection nor can i reach folders created by me and directly speaking to them, i need somethins else than " collection" i guess. somethins like "folders" which i can filter threw. Do you have some ideas? Is there a solution?
This is my data structure. I would like to reach block_hero_banner and some other blocks which are coming next to block_hero_banner. see my image:
Hope you can help me.