Skip to content

Commit 199f178

Browse files
committed
Throw an exception when no model is specified for useGet()
1 parent 1d0994d commit 199f178

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/useGet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export default function get<M extends Model = Model>(options: UseGetOptions): Us
5454
options
5555
)
5656

57+
if (!model) {
58+
throw new Error('No model provided for useGet(). Did you define and register it with FeathersVuex?')
59+
}
60+
5761
function getId(): null | string | number {
5862
return isRef(id) ? id.value : id || null
5963
}

0 commit comments

Comments
 (0)