Unverified Commit 21605a5f authored by Silvio Clécio's avatar Silvio Clécio Committed by GitHub

Fix error 500 (#41205)

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
parent 22ef969b
...@@ -9,7 +9,7 @@ const handler = async (req, res) => { ...@@ -9,7 +9,7 @@ const handler = async (req, res) => {
let respBody = {} let respBody = {}
if (method === 'GET') { if (method === 'GET') {
const { value: items } = await base.fetch([]).next() const { items } = await base.fetch([])
respBody = items respBody = items
res.statusCode = 200 res.statusCode = 200
} else if (method === 'POST') { } else if (method === 'POST') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment