Skip to content

Commit

Permalink
fix(error): cannot read properties of null (reading 'error')
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Brock committed May 16, 2023
1 parent f26d184 commit cbc6fa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ${hookName} = ({ query, options } = {}) => {
})
.then((res) => res.json())
.then((res) => {
if (res.error) {
if (res?.error) {
throw new Error(res.error);
}
return res;
Expand Down Expand Up @@ -111,7 +111,7 @@ export const ${hookName} = ({
})
.then((res) => res.json())
.then((res) => {
if (res.error) {
if (res?.error) {
throw new Error(res.error);
}
return res;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prisma-hooks",
"version": "1.1.13",
"version": "0.1.1",
"type": "module",
"description": "100% type-safe, generated react-query hooks for quering any model in your prisma-managed database.",
"main": "index.js",
Expand Down

0 comments on commit cbc6fa0

Please sign in to comment.