Skip to content

Commit dbd72ff

Browse files
committed
fix: count-getter
1 parent 3d21be7 commit dbd72ff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/service-module/service-module.getters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function makeServiceGetters() {
8080
const cleanQuery = _omit(params.query, FILTERS)
8181
params.query = cleanQuery
8282

83-
return getters.find(state)(params).total
83+
return getters.find(params).total
8484
},
8585
get: ({ keyedById, tempsById, idField, tempIdField }) => (
8686
id,

test/service-module/module.getters.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ describe('Service Module - Getters', function () {
391391
const { state } = this
392392

393393
try {
394-
count(state, { find })({})
394+
count(state, { find: find(state) })({})
395395
} catch (error) {
396396
assert(error)
397397
}
@@ -400,7 +400,9 @@ describe('Service Module - Getters', function () {
400400
it('count returns the number of records in the store', function () {
401401
const { state } = this
402402

403-
const total = count(state, { find })({ query: {} })
403+
const c = count(state, { find })
404+
405+
const total = count(state, { find: find(state) })({ query: {} })
404406
assert(total === 3, 'count is 3')
405407
})
406408
})

0 commit comments

Comments
 (0)