Skip to content

Commit

Permalink
[Doc]: fix rawOutput documentation (#291)
Browse files Browse the repository at this point in the history
* [Doc]: fix rawOutput documentation

* bump babel
  • Loading branch information
snewcomer authored Mar 19, 2021
1 parent de812f3 commit 691f5bb
Show file tree
Hide file tree
Showing 3 changed files with 1,049 additions and 15 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ export default class PersonalNoValidator {
async validate(key, newValue, oldValue, changes, content) {
try {
await fetch(
'/api/personal-no/validation',
{
method: 'POST',
'/api/personal-no/validation',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ data: newValue })
}
);

return true;
} catch (_) {
return 'Personal No is invalid';
Expand Down Expand Up @@ -520,7 +520,11 @@ internationalisation (i18n) for example, or finer-grained error output.
To have `ember-changeset-validations` return such data structure, add the following to you `config/environment.js`

```
ENV['changeset-validations'].rawOutput = true;
let ENV = {
...
'changeset-validations': { rawOutput: true }
...
}
```

This will return an object with the following structure, that you can then pass to your applications's error processing:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"ember-changeset": "^3.13.1",
"ember-cli-babel": "^7.8.0",
"ember-cli-babel": "^7.11.1",
"ember-cli-htmlbars": "^4.0.5",
"ember-get-config": "^0.2.4",
"ember-validators": "^3.0.1"
Expand Down
Loading

0 comments on commit 691f5bb

Please sign in to comment.