Browse Source

Merge pull request #6983 from nocodb/fix/6963-json-cell

fix: Invalid json genration
pull/6994/head
Raju Udava 1 year ago committed by GitHub
parent
commit
8f79fd975b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/nc-gui/components/cell/Json.vue

8
packages/nc-gui/components/cell/Json.vue

@ -72,13 +72,7 @@ const clear = () => {
const formatJson = (json: string) => {
try {
json = json
.trim()
.replace(/^\{\s*|\s*\}$/g, '')
.replace(/\n\s*/g, '')
json = `{${json}}`
return json
return JSON.stringify(JSON.parse(json))
} catch (e) {
console.log(e)
return json

Loading…
Cancel
Save