strapi icon indicating copy to clipboard operation
strapi copied to clipboard

Retrieve single type data

Open de-soul opened this issue 2 years ago • 1 comments

Hello, i using @nuxtjs/strapi v0.3.6 for my Nuxt v2.15.7 application. I created single type named "configuration", but cannot retrieve it from @nuxtjs/strapi module ($strapi.find('configuration')) So, question is: Is single type data supported by @nuxtjs/strapi module? I cannot find any information about this in the documentation

de-soul avatar Mar 21 '22 10:03 de-soul

i didn't find any information on this either. But it works for me.

Create the single type entry. check find method in public role in strapi settings. try to fetch (testing with localhost:1337/configuration or localhost:1337/api/configuration for strapi v4.

sebastianjung avatar Mar 22 '22 14:03 sebastianjung

Hello @de-soul @sebastianjung . You can add in blank quotes using findOne():

const { data: page } = await findOne<Start>("homepage", ""});

This is something that definitely needs to be addressed either in code or in the docs.

jiblett1000 avatar Oct 26 '22 00:10 jiblett1000

@de-soul @sebastianjung As of 1.7.1 you can do this without empty quotes as well.

jiblett1000 avatar Jan 23 '23 22:01 jiblett1000