Has anyone been able to do a handler for the following endpoint or do you have any examples? The endpoint does return correct data in the browser, but not sure how to do this inside frontity. It just says server not found, but the endpoint works in the browser.
/wp-json/acf/v3/pages/2
export const homeSlideHandler = {
name: "homeSliderItems",
priority: 10,
pattern: "slider/",
func: async ({ route, state, libraries }) => {
const { api } = libraries.source;
const response = await api.get({
endpoint: "/wp-json/acf/v3/pages/2",
});
const items = await response.json();
const currentPageData = state.source.data[route];
Object.assign(currentPageData, {
items
});
}
}
Thanks in advance!