Skip to content

Commit 8571f94

Browse files
authored
Added check for getterParams is not undefined, to enable documented "return null" feature
Added check for getterParams is not undefined, to enable documented "return null" feature as described in https://vuex.feathersjs.com/composition-api.html#options (before returning null in the computed threw an error because paginate couldn't be found on a null object)
1 parent 68f1dac commit 8571f94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useFind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default function find(options: UseFindOptions): UseFindData {
9797
items: computed<any[]>(() => {
9898
const getterParams = unwrapParams(params)
9999

100-
if (getterParams.paginate) {
100+
if (getterParams && getterParams.paginate) {
101101
const serviceState = model.store.state[model.servicePath]
102102
const { defaultSkip, defaultLimit } = serviceState.pagination
103103
const skip = getterParams.query.$skip || defaultSkip

0 commit comments

Comments
 (0)