We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a35234 commit c75a994Copy full SHA for c75a994
examples/svelte/optimistic-updates/src/routes/api/data/+server.ts
@@ -19,8 +19,9 @@ export const POST: RequestHandler = async ({ request }) => {
19
const { text } = await request.json()
20
21
if (Math.random() > 0.7) {
22
- json({ message: 'Could not add item!' }, { status: 500 })
+ return json({ message: 'Could not add item!' }, { status: 500 })
23
}
24
+
25
const newTodo = {
26
id: Math.random().toString(),
27
text: text.toUpperCase() as string,
0 commit comments