mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Merge branch 'fix/windows-import-export' of https://github.com/strapi/strapi into fix/windows-import-export
This commit is contained in:
commit
de8351ffbe
@ -22,12 +22,6 @@ class PostgresDialect extends Dialect {
|
||||
'text',
|
||||
(v) => v
|
||||
);
|
||||
// Don't parse JSONB automatically
|
||||
this.db.connection.client.driver.types.setTypeParser(
|
||||
this.db.connection.client.driver.types.builtins.JSONB,
|
||||
'text',
|
||||
(v) => v
|
||||
);
|
||||
this.db.connection.client.driver.types.setTypeParser(
|
||||
this.db.connection.client.driver.types.builtins.NUMERIC,
|
||||
'text',
|
||||
|
@ -8,7 +8,12 @@ class JSONField extends Field {
|
||||
}
|
||||
|
||||
fromDB(value) {
|
||||
if (typeof value === 'string') return JSON.parse(value);
|
||||
try {
|
||||
if (typeof value === 'string') return JSON.parse(value);
|
||||
} catch (error) {
|
||||
// Just return the value if it's not a valid JSON string
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user