fix: Update getSearchPosts URL construction for pagination

This commit is contained in:
Himanshu
2025-11-20 22:24:31 +05:30
parent 351ac35ed7
commit a98b1b72ca
2 changed files with 6 additions and 2 deletions

View File

@@ -33,7 +33,11 @@ export const getSearchPosts = async function ({
}): Promise<Post[]> {
const { getBaseUrl, cheerio } = providerContext;
const baseUrl = await getBaseUrl("4khdhub");
const url = `${baseUrl}/page/${page}?s=${searchQuery}`;
const url =
page == 1
? `${baseUrl}/?s=${searchQuery}`
: `${baseUrl}/page/${page}?s=${searchQuery}`;
console.log("4khdhubGetSearchPosts url", url);
return posts({ url, signal, cheerio });
};