@kaspernj/api-maker 1.0.356 → 1.0.357
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/package.json +1 -1
- package/src/use-collection.mjs +2 -2
package/package.json
CHANGED
package/src/use-collection.mjs
CHANGED
|
@@ -107,7 +107,7 @@ const useCollection = (props, cacheKeys = []) => {
|
|
|
107
107
|
}, [])
|
|
108
108
|
|
|
109
109
|
const loadModels = useCallback(async () => {
|
|
110
|
-
let query = s.
|
|
110
|
+
let query = s.props.collection?.clone() || s.p.modelClass.ransack()
|
|
111
111
|
|
|
112
112
|
if (s.props.pagination) {
|
|
113
113
|
const page = s.m.queryParams[s.s.queryPageName] || 1
|
|
@@ -126,7 +126,6 @@ const useCollection = (props, cacheKeys = []) => {
|
|
|
126
126
|
|
|
127
127
|
query = query
|
|
128
128
|
.ransack(s.s.qParams)
|
|
129
|
-
.ransack(s.props.ransack)
|
|
130
129
|
.search(s.s.searchParams)
|
|
131
130
|
.searchKey(s.s.queryQName)
|
|
132
131
|
.pageKey(s.s.queryPageName)
|
|
@@ -135,6 +134,7 @@ const useCollection = (props, cacheKeys = []) => {
|
|
|
135
134
|
if (s.props.abilities) query.abilities(s.p.abilities)
|
|
136
135
|
if (s.props.limit !== undefined) query.limit(s.p.limit)
|
|
137
136
|
if (s.props.preloads) query.preload(s.p.preloads)
|
|
137
|
+
if (s.props.ransack) query.ransack(s.props.ransack)
|
|
138
138
|
if (s.props.select) query.select(s.p.select)
|
|
139
139
|
if (s.props.selectColumns) query.selectColumns(s.p.selectColumns)
|
|
140
140
|
|