Skip to content

Commit

Permalink
fix(pagination): total length (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
kishore03109 authored Nov 14, 2023
1 parent 0974c9a commit 54b44c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/db/RepoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const getPaginatedDirectoryContents = (
file.name.toLowerCase().includes(search.toLowerCase())
)
}
const totalLength = sortedFiles.value().length

const paginatedFiles = sortedFiles
.drop(page * limit)
Expand All @@ -67,7 +68,7 @@ const getPaginatedDirectoryContents = (
return {
directories: subdirectories,
files: paginatedFiles,
total: files.length,
total: totalLength,
}
}

Expand Down

0 comments on commit 54b44c1

Please sign in to comment.