Skip to content

Commit 13076b9

Browse files
committed
Throw an exception when no model is specified for useFind()
1 parent 199f178 commit 13076b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/useFind.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export default function find<M extends Model = Model>(options: UseFindOptions):
6666
options
6767
)
6868

69+
if (!model) {
70+
throw new Error('No model provided for useFind(). Did you define and register it with FeathersVuex?')
71+
}
72+
6973
const getFetchParams = (providedParams?: Params | Ref<Params>): Params => {
7074
const provided = unwrapParams(providedParams)
7175

0 commit comments

Comments
 (0)