Skip to content

Commit

Permalink
Typo in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox committed Mar 24, 2021
1 parent 94159e7 commit 65150d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ const pattern = (v) => /^[a-z0-9_#]+$/i.test(v) || t('form.invalidPattern') // u
Rules can also be asynchronous:
```js
const isUnique = async v => {
const isUnique = async (v) => {
const response = await fetch(`/api/is-unique/${v}`)
// Assuming API returns non-200 code when not unique
return response.ok || 'Already in use'
}
```
In this case, you'll need to use `validateAsync` instead of `validate`:
Expand Down

0 comments on commit 65150d3

Please sign in to comment.