-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rosado/712-validation-msg
- Loading branch information
Showing
46 changed files
with
1,110 additions
and
962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ email: { | |
validations: { | ||
maxFileSize: 100000000 | ||
} | ||
contact: | ||
issues: | ||
# description: should be used for general issues, e.g. if user lands on 404 doesn't know how to proceed | ||
email: [email protected] | ||
datasetsConfig: | ||
article-4-direction: | ||
guidanceUrl: /guidance/specifications/article-4-direction | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as v from 'valibot' | ||
|
||
/** | ||
* Takes an Error and if it's a ValiError, returns an array of issue summaries (with paths). Empty array otherwise. | ||
* | ||
* Useful to show the schema issues in a consise way. | ||
* | ||
* @param {Error} error | ||
* @returns { { path: string[], message: string}[] } | ||
*/ | ||
export function schemaIssues (error) { | ||
const issues = [] | ||
if (v.isValiError(error)) { | ||
for (const issue of error.issues) { | ||
if (issue.path) { | ||
issues.push({ path: issue.path.map(elem => elem.key), message: issue.message }) | ||
} | ||
} | ||
} | ||
return issues | ||
} |
Oops, something went wrong.