Fetching blog posts when product is set as main postEndpoint

In my site in frontity.settings.js I have set the postEndpoint to be product as that is the most important for me. However, how I am having some issues, and I am not sure what is the best way to solve it as I am still trying to get a grasp of wp-source.

So logically, now that I have postEndpoint set to product, when I visit the blog page, i can see my products instead of posts. I am wondering what would be the best way to fetch the posts when visiting the posts page(List component).

Should I do it in useEffect() or do I use a handler?
Any help would be appreciated.

Here are my settings of wp-source:

{
      name: "@frontity/wp-source",
      state: {
        source: {
          api: "https://kh-api.whaledev.com/wp-json/",
          params: {
            per_page: 20,
          },
          homepage: "/home/",
          postsPage: "/blog/",
          postEndpoint: "product",
          postTypes: [
            {
              type: "post",
              endpoint: "post",
              archive: "/post",
            },
            {
              type: "product",
              endpoint: "product",
              archive: "/product",
            },
            {
              type: "media",
              endpoint: "media",
              archive: "/media",
            },
            {
              type: "page",
              endpoint: "page",
            },
          ],
        },
      },
    },

Hi @ni.bonev,

Sorry for the delay in the answer. We lost track of this post from all the posts we (Frontity Team) moderate

Did you manage to solve this issue?

Regarding your question: useEffect will only be executed on the client side while a handler can be triggered from both client side and server side

Here you have a more detailed explanation about this

Hope this helps