From 2eab76e1353e7b65762a1024f25f359703ea10c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Silvio=20Cl=C3=A9cio?= Date: Wed, 5 Oct 2022 23:48:37 -0300 Subject: [PATCH] Fix error 500 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 --- examples/with-deta-base/pages/api/todos/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-deta-base/pages/api/todos/index.js b/examples/with-deta-base/pages/api/todos/index.js index 1609a9736e8a6..f5eac468a264c 100644 --- a/examples/with-deta-base/pages/api/todos/index.js +++ b/examples/with-deta-base/pages/api/todos/index.js @@ -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') {