-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add query details to query view page (#62)
* add query details to query view page * query params values should not be links * Update server/app/query/view/[id]/page.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix copy paste error * create queryParams variable to simply templating code * make the query-details template less repetative * add a JSONSafeParse function to handle parsing errors --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3246245
commit 7c4f9cf
Showing
2 changed files
with
83 additions
and
11 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
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,12 @@ | ||
export function JSONSafeParse(s: string) { | ||
try { | ||
return JSON.parse(s); | ||
} catch (error) { | ||
if (error instanceof SyntaxError) { | ||
console.error(`${error}`); | ||
console.error(`Failed to parse JSON from string ${s}`); | ||
return {}; | ||
} | ||
throw error; | ||
} | ||
} |