refactor(♻️ Add defaults everywhere (+ settings page)):
This commit is contained in:
@ -31,7 +31,11 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const data = JSON.parse(req.body)
|
||||
const typebots = await prisma.typebot.update({
|
||||
where: { id: typebotId },
|
||||
data,
|
||||
data: {
|
||||
...data,
|
||||
theme: data.theme ?? undefined,
|
||||
settings: data.settings ?? undefined,
|
||||
},
|
||||
})
|
||||
return res.send({ typebots })
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Flex } from '@chakra-ui/layout'
|
||||
import { Seo } from 'components/Seo'
|
||||
import { SettingsContent } from 'components/settings/SettingsContent'
|
||||
import { SettingsContent } from 'layouts/settings/SettingsContent'
|
||||
import { TypebotHeader } from 'components/shared/TypebotHeader'
|
||||
import React from 'react'
|
||||
|
||||
|
Reference in New Issue
Block a user