Skip to content

Commit

Permalink
fix for invalid json
Browse files Browse the repository at this point in the history
  • Loading branch information
nandangrover committed Dec 14, 2023
1 parent 2058d75 commit 69c965d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/core/resumeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ class resumeEditor {
}

async submitJsonChange() {
// Before submitting check if it's valid JSON, if not, alert the user
const jsonData = this.codeEditor.getValue();
try {
JSON.parse(jsonData);
} catch (e) {
alert('Invalid JSON. Please check your JSON and try again');
return;
}

let config = {};
try {
config = await gateway.updateJson(this.inputId, this.themeSelected, this.codeEditor.getValue());
Expand Down

0 comments on commit 69c965d

Please sign in to comment.