-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve code/schema validation before registering (#495)
More info about this can be found on this [issue](#483) Changes on this PR: - Validate code & schema before registering the indexer Logic: If formatting either the code or the schema fails, the `Publish` button is disabled. Only if type generation errors or no errors are detected, the `Publish` button will be enabled. More about this on this [discussion](#480 (comment)) https://github.com/near/queryapi/assets/15988846/68f89cb4-f561-4e8a-9fa7-81c1a38e548c Additionally - Created a reusable Modal with a global context to manage it, so we can trigger it from any component to display some info - Updated schema with granular error types for improved clarity - Created a custom error class to filter by type Error. We can add more fields on it if needed --------- Co-authored-by: Juan Luis Santana <juanluis@near.org> Co-authored-by: Roshaan Siddiqui <siddiqui.roshaan@gmail.com>
- Loading branch information
1 parent
b76fac0
commit 81edb7e
Showing
11 changed files
with
330 additions
and
168 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class ValidationError extends Error { | ||
constructor(message, type) { | ||
super(message); | ||
this.type = type; | ||
} | ||
} |
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
Oops, something went wrong.