File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
examples/react/saas-large/src Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,14 @@ export const productsCollection = createCollection(
5151 const { subscription : _subscription , ...rest } = loadSubsetOptions
5252 console . log ( JSON . stringify ( rest ) )
5353 const page = computePageNumber ( loadSubsetOptions . limit )
54- const limit = loadSubsetOptions . limit + 1
54+ const limit = loadSubsetOptions . limit
5555 const orderBy = loadSubsetOptions . orderBy
5656 const where = loadSubsetOptions . where
5757
5858 const result = await getProducts ( {
5959 data : {
6060 page,
61- limit,
61+ limit : limit ? limit + 1 : undefined ,
6262 orderBy : orderBy ? JSON . stringify ( orderBy ) : undefined ,
6363 where : where ? JSON . stringify ( where ) : undefined ,
6464 } ,
Original file line number Diff line number Diff line change @@ -160,8 +160,9 @@ export const getProducts = createServerFn({ method: `GET` })
160160 } )
161161 }
162162
163- const startIndex = page * limit
164- const endIndex = startIndex + limit
163+ const itemsPerPage = 50
164+ const startIndex = page * itemsPerPage
165+ const endIndex = limit
165166 const paginatedProducts = filteredProducts . slice ( startIndex , endIndex )
166167
167168 return paginatedProducts
You can’t perform that action at this time.
0 commit comments