Skip to content

Commit 66bb8b7

Browse files
committed
Remove total_count and deprecated_count in pagination results
1 parent 253dfb3 commit 66bb8b7

15 files changed

Lines changed: 18 additions & 20 deletions

File tree

src/commands/blueprint/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const ListBlueprintsUI = ({
148148
const result = {
149149
items: pageBlueprints,
150150
hasMore: page.has_more || false,
151-
totalCount: page.total_count || pageBlueprints.length,
151+
totalCount: pageBlueprints.length,
152152
};
153153

154154
return result;

src/commands/devbox/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const ListDevboxesUI = ({
117117
const result = {
118118
items: pageDevboxes,
119119
hasMore: page.has_more || false,
120-
totalCount: page.total_count || pageDevboxes.length,
120+
totalCount: pageDevboxes.length,
121121
};
122122

123123
return result;

src/commands/gateway-config/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const ListGatewayConfigsUI = ({
162162
const result = {
163163
items: pageConfigs,
164164
hasMore: page.has_more || false,
165-
totalCount: page.total_count || pageConfigs.length,
165+
totalCount: pageConfigs.length,
166166
};
167167

168168
return result;

src/commands/network-policy/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const ListNetworkPoliciesUI = ({
173173
const result = {
174174
items: pagePolicies,
175175
hasMore: page.has_more || false,
176-
totalCount: page.total_count || pagePolicies.length,
176+
totalCount: pagePolicies.length,
177177
};
178178

179179
return result;

src/commands/object/list.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,13 @@ const ListObjectsUI = ({
172172
// Access pagination properties from the result
173173
const pageResult = result as unknown as {
174174
objects: unknown[];
175-
total_count?: number;
176175
has_more?: boolean;
177176
};
178177

179178
return {
180179
items: pageObjects,
181180
hasMore: pageResult.has_more || false,
182-
totalCount: pageResult.total_count || pageObjects.length,
181+
totalCount: pageObjects.length,
183182
};
184183
},
185184
[search.submittedSearchQuery],

src/commands/snapshot/list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const ListSnapshotsUI = ({
142142
const result = {
143143
items: pageSnapshots,
144144
hasMore: page.has_more || false,
145-
totalCount: page.total_count || pageSnapshots.length,
145+
totalCount: pageSnapshots.length,
146146
};
147147

148148
return result;

src/services/benchmarkJobService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function listBenchmarkJobs(
7979

8080
return {
8181
jobs,
82-
totalCount: page.total_count || jobs.length,
82+
totalCount: jobs.length,
8383
hasMore: page.has_more || false,
8484
};
8585
}

src/services/benchmarkService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function listBenchmarkRuns(
6666

6767
return {
6868
benchmarkRuns,
69-
totalCount: page.total_count || benchmarkRuns.length,
69+
totalCount: benchmarkRuns.length,
7070
hasMore: page.has_more || false,
7171
};
7272
}
@@ -105,7 +105,7 @@ export async function listScenarioRuns(
105105

106106
return {
107107
scenarioRuns,
108-
totalCount: page.total_count || scenarioRuns.length,
108+
totalCount: scenarioRuns.length,
109109
hasMore: page.has_more || false,
110110
};
111111
}
@@ -124,7 +124,7 @@ export async function listScenarioRuns(
124124

125125
return {
126126
scenarioRuns,
127-
totalCount: page.total_count || scenarioRuns.length,
127+
totalCount: scenarioRuns.length,
128128
hasMore: page.has_more || false,
129129
};
130130
}
@@ -166,7 +166,7 @@ export async function listBenchmarks(
166166

167167
return {
168168
benchmarks,
169-
totalCount: page.total_count || benchmarks.length,
169+
totalCount: benchmarks.length,
170170
hasMore: page.has_more || false,
171171
};
172172
}

src/services/blueprintService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function listBlueprints(
7979

8080
const result = {
8181
blueprints,
82-
totalCount: page.total_count || blueprints.length,
82+
totalCount: blueprints.length,
8383
hasMore: page.has_more || false,
8484
};
8585

src/services/devboxService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export async function listDevboxes(
130130

131131
const result = {
132132
devboxes,
133-
totalCount: page.total_count || devboxes.length,
133+
totalCount: devboxes.length,
134134
hasMore: page.has_more || false,
135135
};
136136

0 commit comments

Comments
 (0)