🗃️ Remove list types from db schema
This commit is contained in:
@ -54,7 +54,14 @@ export const subscribeWebhookProcedure = authenticatedProcedure
|
||||
await prisma.webhook.upsert({
|
||||
where: { id: webhookBlock.webhookId },
|
||||
update: { url, body: '{{state}}', method: 'POST' },
|
||||
create: { url, body: '{{state}}', method: 'POST', typebotId },
|
||||
create: {
|
||||
url,
|
||||
body: '{{state}}',
|
||||
method: 'POST',
|
||||
typebotId,
|
||||
headers: [],
|
||||
queryParams: [],
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
|
@ -49,6 +49,7 @@ export function CustomAdapter(p: PrismaClient): Adapter {
|
||||
},
|
||||
},
|
||||
},
|
||||
onboardingCategories: [],
|
||||
},
|
||||
})
|
||||
if (process.env.USER_CREATED_WEBHOOK_URL)
|
||||
|
@ -2,6 +2,7 @@ import prisma from '@/lib/prisma'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { getAuthenticatedUser } from '@/features/auth/api'
|
||||
import { methodNotAllowed, notAuthenticated } from 'utils/api'
|
||||
import { User } from 'db'
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const user = await getAuthenticatedUser(req)
|
||||
@ -9,10 +10,15 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
const id = req.query.userId as string
|
||||
if (req.method === 'PUT') {
|
||||
const data = typeof req.body === 'string' ? JSON.parse(req.body) : req.body
|
||||
const data = (
|
||||
typeof req.body === 'string' ? JSON.parse(req.body) : req.body
|
||||
) as User
|
||||
const typebots = await prisma.user.update({
|
||||
where: { id },
|
||||
data,
|
||||
data: {
|
||||
...data,
|
||||
onboardingCategories: data.onboardingCategories ?? [],
|
||||
},
|
||||
})
|
||||
return res.send({ typebots })
|
||||
}
|
||||
|
Reference in New Issue
Block a user