refactor for file page

This commit is contained in:
smanylov
2026-03-26 11:56:36 +07:00
parent 4d5bae0812
commit a9861967ef
17 changed files with 50 additions and 36 deletions
+14 -3
View File
@@ -39,8 +39,6 @@ export async function searchUserFiles(fileId: string) {
export async function searchGlobalFiles(fileId: string, currentPage: number) {
const token = await getSessionData('token');
console.log('searchGlobalFiles');
console.log(currentPage);
//удалить когда поиск будет нормально работать
/* return {
@@ -114,13 +112,26 @@ export async function searchGlobalFiles(fileId: string, currentPage: number) {
}
} catch (error) {
let errorMessage: string = 'error';
if (error) {
const typedError = error as any;
switch (typedError.message_desc) {
case 'No results found':
errorMessage = 'no-similar-files-title'
break;
default:
errorMessage = 'error'
break;
}
}
return {
images: [],
page: 0,
pageSize: 0,
totalPages: 0,
totalResults: 0,
error: 'error'
error: errorMessage
}
}
}