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
I am fairly new to TypeScript and I wanted to create a Nuxt 3 app with Strapi 4 with TypeScript. On Strapi I have plugins "strapi-plugin-transformer" for flattening my response and "shemas-to-ts" for generating TS types. So far everything worked quite well but now I have been stuck for a while on, I bet pretty simple stuff. I have single type in Strapi called Header and I am trying to load all data on FE. I took the generated type from Strapi which looks like this:
The problem I have is, that I get the data from BE but in my loadData function I am getting Vue: Type Strapi4ResponseData<Header_Plain>[] is not assignable to type error. I know that I probably should use findOne instead of find but when I use findOne the problem still occurs. Could anyone help me with this? I simply don't understand why my BE data are wrapped in this Strapi4ResponseData or how I should take them out.
The text was updated successfully, but these errors were encountered:
Hello there!
I am fairly new to TypeScript and I wanted to create a Nuxt 3 app with Strapi 4 with TypeScript. On Strapi I have plugins "strapi-plugin-transformer" for flattening my response and "shemas-to-ts" for generating TS types. So far everything worked quite well but now I have been stuck for a while on, I bet pretty simple stuff. I have single type in Strapi called Header and I am trying to load all data on FE. I took the generated type from Strapi which looks like this:
then, in my Nuxt, I have this code:
The problem I have is, that I get the data from BE but in my loadData function I am getting Vue: Type Strapi4ResponseData<Header_Plain>[] is not assignable to type error. I know that I probably should use findOne instead of find but when I use findOne the problem still occurs. Could anyone help me with this? I simply don't understand why my BE data are wrapped in this Strapi4ResponseData or how I should take them out.
The text was updated successfully, but these errors were encountered: