Skip to content

Commit

Permalink
content: fix example in h3 towards the edge of the web blog post (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: Pooya Parsa <[email protected]>
  • Loading branch information
MickL and pi0 authored Dec 28, 2023
1 parent a9f2130 commit ed0a12f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ const userSchema = z.object({
})

export default defineEventHandler(async (event) => {
const user = await readValidatedBody(event, userSchema.safeParse) // or `.parse` to throw an error
const result = await readValidatedBody(event, body => userSchema.safeParse(body).data) // or `.parse` to directly throw an error

if (!result.success) {

Check failure on line 142 in content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md

View workflow job for this annotation

GitHub Actions / Lint

Unnecessary { after 'if' condition
throw result.error.issues;

Check failure on line 143 in content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md

View workflow job for this annotation

GitHub Actions / Lint

Expected indentation of 4 spaces but found 5

Check failure on line 143 in content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md

View workflow job for this annotation

GitHub Actions / Lint

Extra semicolon
}

Check failure on line 145 in content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md

View workflow job for this annotation

GitHub Actions / Lint

Trailing spaces not allowed

Check failure on line 145 in content/5.blog/2023-08-15-h3-towards-the-edge-of-the-web.md

View workflow job for this annotation

GitHub Actions / Lint

Trailing spaces not allowed
// User object is validated and typed!
return user
return result.data
})
```

Expand Down

0 comments on commit ed0a12f

Please sign in to comment.