Hi @alexaspalato !!
Thereās not really a way to ādisableā pagination. The WP REST API will return a maximum of 100 posts in one request. So this means that we can show āallā posts as long as āallā is some integer smaller than 100 If we need more than 100 posts on one page, then we have to do another request from the client, but thatās probably not what we want.
However, you can solve your problem with a custom handler the following way (code modified from your repo):
// src/index.js
init: ({ libraries }) => {
libraries.source.handlers.push({
name: "custom_category",
priority: 10,
pattern: "/",
func: async ({ link, params, state, libraries, force }) => {
// 1. get all posts for the category
const response = await libraries.source.api.get({
endpoint: "posts",
params: { categories: 1780 },
});
// 2. add items to state
const items = await libraries.source.populate({
response,
state,
force,
});
const { type, id } = state.source.get("/");
// 3. add link to data.
// Might need to add more details to the state
// (look at the examples of other
// handlers in the frontity repo)
Object.assign(state.source.data[link], {
id,
type,
isHome: true,
isArchive: true,
items,
});
},
});
},
Then, in the Archive component just do:
// Archive.js
const Archive = ({ state, actions, showMedia }) => {
const data = getUrlData(state);
const author = state.source.author[data.id];
const items = data.items;
return (
<>
... same as it was, just comment out the pagination component
{/* <Pagination /> */}
</>
)
}
By the way, we are slowly working on a version 2.0 of wp-source which will allow you to solve such problems just by adding some configuration to the frontity state! Stay tuned!