Hey guys,
I’ve just started my second Frontity project, this time trying TS. Sadly I’ve ran into problems I haven’t faced in my other application. Have been comparing them for hours without any actual understanding why one of them is working, and the other isn’t.
Shortly my issue is that const data = state.source.get(state.router.link);
only fetches for post type in the WP Rest API, but the content is placed in the page API. WP Source handles this for my other application, but not for this one. Could anyone maybe help me with a pair of clear eyes?
My setup is as follows:
-
"@frontity/core": "1.8.0",
-
"@frontity/head-tags": "1.0.6",
-
"@frontity/html2react": "1.3.4",
-
"@frontity/tiny-router": "1.2.1",
-
"@frontity/wp-source": "1.8.2",
WP Source in frontity.settings.ts:
import { Settings } from “frontity/types”;
const settings: Settings = {
"name": "bergbil-frontend",
"state": {
"frontity": {
"debug": false,
"url": "https://bergbil.se",
"title": "Berg Bil AB",
"description": "Berg Bil AB"
},
"source": {
"api": "https://bergbil.se/wp-json",
}
},
"packages": [
{
"name": "bergbil-frontend-theme",
"state": {
"theme": {
"featured": {
"showOnList": false,
"showOnPost": false
}
}
}
},
{
"name": "@frontity/wp-source",
"state": {
"source": {
"api": "https://bergbil.se/wp-json",
"postsPage": "/nyheter",
"homepage": "/startsidan",
"postTypes": [
{
"type": "produkt",
"endpoint": "produkt",
"archive": "/product",
},
],
},
}
},
"@frontity/tiny-router",
"@frontity/html2react",
"@frontity/head-tags",
]
};
export default settings;
Thanks in advance.