Skip to content

Commit 083bcda

Browse files
Guilherme RabeloGuilherme Rabelo
authored andcommitted
refactor(examples/nextjs-app-optimistic-updates): apply post-review corrections
1 parent 7ad24c1 commit 083bcda

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

examples/react/nextjs-app-optimistic-updates/.eslintrc.cjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/react/nextjs-app-optimistic-updates/app/api/todos/route.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ export async function GET() {
66
}
77

88
export async function POST(request: Request) {
9-
const body = (await request.json()) as unknown
9+
let body: unknown
10+
try {
11+
body = await request.json()
12+
} catch {
13+
return NextResponse.json({ error: 'text is required' }, { status: 400 })
14+
}
1015

1116
const text =
1217
body !== null &&

0 commit comments

Comments
 (0)