Epic Next.js 14 Tutorial: Learn Next.js by building a real-life project part 3

Hello Paul,

Thanks for the work you’ve done working on this blog posts !
I have a question regarding the flattenAttributes helper.
Is there a way to properly type it using the types generated by the strapi typescript command ?

I have been reading : Improve Your Frontend Experience With Strapi Types And TypeScript that provide a way to type strapi responses (e.g: with APIResponseCollection<"api::post.post">) and I try to find a way to use it to generically type the flattenAttributes helper.

Thanks in advance !

1 Like