add pagination for test

This commit is contained in:
smanylov
2026-02-10 15:40:18 +07:00
parent 0898ea9aa0
commit 40e6172c0b
5 changed files with 162 additions and 39 deletions
+37 -2
View File
@@ -28,8 +28,43 @@ export async function searchUserFiles(fileId: string) {
}
}
export async function searchGlobalFiles(fileId: string) {
export async function searchGlobalFiles(fileId: string, currentPage: number) {
const token = await getSessionData('token');
console.log('searchGlobalFiles');
console.log(currentPage);
/* return {
images: [
{
url: 'string1',
pageTitle: `string1 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string2 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
},
{
url: 'string1',
pageTitle: `string3 from page ${currentPage}`,
height: 100,
width: 100,
host: 'string1',
pageUrl: 'string1'
}
],
page: 0,
pageSize: 0,
totalPages: 10,
totalResults: 100,
} */
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -77,7 +112,7 @@ export async function getSearchStats() {
}
});
if (response.ok) {
let parsed = await response.json();