rastack 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.29](https://github.com/theserverkid/reactapistack/compare/v0.0.28...v0.0.29) (2026-07-10)
6
+
5
7
  ### [0.0.28](https://github.com/theserverkid/reactapistack/compare/v0.0.27...v0.0.28) (2026-07-10)
6
8
 
7
9
  ### [0.0.27](https://github.com/theserverkid/reactapistack/compare/v0.0.26...v0.0.27) (2026-07-10)
@@ -134,8 +134,19 @@ export function useGetPaginatedQueryList<TParam, TResult>({
134
134
  },
135
135
  );
136
136
 
137
- const pageCount = query.data?.pagination?.last || 0;
138
- const itemCount = query.data?.pagination?.count || 0;
137
+ // The list envelope is either nested (`{ pagination: { count, last } }`, the
138
+ // Django/DRF-paginated shape) or flat DRF-classic (`{ count, next, previous,
139
+ // results }`, what the in-browser WASM core returns). Support both: prefer the
140
+ // nested fields, else fall back to the top-level `count` and derive the page
141
+ // count from the active page size. Without this, a flat envelope leaves
142
+ // `pageCount`/`itemCount` at 0, which disables paging and hides the total.
143
+ const topLevelCount = (query.data as { count?: number } | undefined)?.count;
144
+ const itemCount = query.data?.pagination?.count ?? topLevelCount ?? 0;
145
+ const pageCount =
146
+ query.data?.pagination?.last ??
147
+ (itemCount
148
+ ? Math.max(1, Math.ceil(itemCount / (serverQueryParamState.page_size || 1)))
149
+ : 0);
139
150
 
140
151
  function previousPage() {
141
152
  if (queryParamState.page) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rastack",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "main": "runtime.ts",
6
6
  "types": "runtime.ts",