2
0

🐛 Fix typebot parsing for legacy columnsWidth setting

This commit is contained in:
Baptiste Arnaud
2023-11-15 15:39:20 +01:00
parent 7cf64a1abb
commit 8d563499f0
2 changed files with 11 additions and 2 deletions

View File

@ -21,3 +21,6 @@ export const preprocessGroup = (group: any) => ({
...group,
blocks: group.blocks ?? [],
})
export const preprocessColumnsWidthResults = (arg: unknown) =>
Array.isArray(arg) && arg.length === 0 ? {} : arg

View File

@ -3,7 +3,10 @@ import { settingsSchema } from './settings'
import { themeSchema } from './theme'
import { variableSchema } from './variable'
import { Typebot as TypebotPrisma } from '@typebot.io/prisma'
import { preprocessTypebot } from './helpers/preprocessTypebot'
import {
preprocessColumnsWidthResults,
preprocessTypebot,
} from './helpers/preprocessTypebot'
import { edgeSchema } from './edge'
import { groupV5Schema, groupV6Schema } from './group'
import { startEventSchema } from '../events/start/schema'
@ -11,7 +14,10 @@ import { startEventSchema } from '../events/start/schema'
export const resultsTablePreferencesSchema = z.object({
columnsOrder: z.array(z.string()),
columnsVisibility: z.record(z.string(), z.boolean()),
columnsWidth: z.record(z.string(), z.number()),
columnsWidth: z.preprocess(
preprocessColumnsWidthResults,
z.record(z.string(), z.number())
),
})
const isDomainNameWithPathNameCompatible = (str: string) =>