2
0
Files
bot/apps/builder/src/features/blocks/integrations/webhook/queries/updateWebhookQuery.ts
Baptiste Arnaud ac464eabdf ♻️ (editor) Improve webhook creation
Remove terrible useEffects
2023-02-15 14:51:58 +01:00

16 lines
401 B
TypeScript

import { Webhook } from 'models'
import { sendRequest } from 'utils'
type Props = {
typebotId: string
webhookId: string
data: Partial<Omit<Webhook, 'id' | 'typebotId'>>
}
export const updateWebhookQuery = ({ typebotId, webhookId, data }: Props) =>
sendRequest<{ webhook: Webhook }>({
method: 'PATCH',
url: `/api/typebots/${typebotId}/webhooks/${webhookId}`,
body: { data },
})