Restore "Fix "Create profile" page not supporting dark mode (#8110)" & Fix string defaultValues during sync-metadata (#9220)
Restoring https://github.com/twentyhq/twenty/pull/9185 Also fixing sync-metadata with test values in jsonb ## Test sync-metadata on existing workspaces should replace colorSchema in both metadata and workspaceMember tables
This commit is contained in:
@ -193,7 +193,7 @@ export class WorkspaceFieldComparator {
|
||||
if (
|
||||
(fieldPropertiesToStringify as readonly string[]).includes(property)
|
||||
) {
|
||||
fieldPropertiesToUpdateMap[id][property] = JSON.parse(
|
||||
fieldPropertiesToUpdateMap[id][property] = this.parseJSONOrString(
|
||||
difference.value,
|
||||
);
|
||||
} else {
|
||||
@ -233,4 +233,16 @@ export class WorkspaceFieldComparator {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private parseJSONOrString(value: string | null): string | object | null {
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user