Skip to content

Commit

Permalink
Fix error 500 (#41205)
Browse files Browse the repository at this point in the history
Fix the following problem:

```
  page: '/api/todos'
}
  10 | 
  11 |   if (method === 'GET') {
> 12 |     const { value: items } = await base.fetch([]).next()
     |                                                  ^
  13 |     respBody = items
  14 |     res.statusCode = 200
  15 |   } else if (method === 'POST') {
warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
```

Working app -> https://with-deta-base-ashy.vercel.app
Temp repo -> https://github.com/silvioprog/with-deta-base
  • Loading branch information
silvioprog committed Oct 6, 2022
1 parent 22ef969 commit 21605a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/with-deta-base/pages/api/todos/index.js
Expand Up @@ -9,7 +9,7 @@ const handler = async (req, res) => {
let respBody = {}

if (method === 'GET') {
const { value: items } = await base.fetch([]).next()
const { items } = await base.fetch([])
respBody = items
res.statusCode = 200
} else if (method === 'POST') {
Expand Down

0 comments on commit 21605a5

Please sign in to comment.