add pagination for test
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user