Skip to content

Commit

Permalink
fix: fix page size not being set and loading not being shown
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Oct 22, 2024
1 parent c8d1724 commit 2a22ce0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/api/services/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,14 @@ export async function getConfigsChanges({
if (severity) {
requestData.set("severity", severity);
}
if (pageIndex && pageSize) {
if (pageIndex) {
requestData.set("page", parseInt(pageIndex.toString()) + 1);
}

if (pageSize) {
requestData.set("page_size", pageSize);
}

if (sortBy) {
// for descending order, we need to add a "-" before the sortBy field
requestData.set("sort_by", `${sortOrder === "desc" ? "-" : ""}${sortBy}`);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/config/ConfigChangesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function ConfigChangesPage() {
<ConfigChangeFilters paramsToReset={["page"]} />
<ConfigChangeTable
data={changes}
isLoading={isLoading}
isLoading={isLoading || isRefetching}
totalRecords={totalChanges}
numberOfPages={totalChangesPages}
/>
Expand Down

0 comments on commit 2a22ce0

Please sign in to comment.