mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Set onEditWebhook data from Table
This commit is contained in:
parent
0eeb005c14
commit
8662c54589
1 changed files with 4 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ export default function Webhooks(): JSX.Element {
|
|||
const { webhooks, revalidate } = useGetWebhooksQuery()
|
||||
const [onDeleteId, setOnDeleteId] = useState<string | null>(null)
|
||||
const [addModelOpen, setAddModelOpen] = useState(false)
|
||||
const [onEditId, setOnEditId] = useState<string>('')
|
||||
const [onEditWebhook, setOnEditWebhook] = useState<Webhook | null>(null)
|
||||
const [url, setUrl] = useState('')
|
||||
const [eventTypes, setEventTypes] = useState<WebhookEvent[]>([
|
||||
'PAGE_CREATED',
|
||||
|
|
@ -109,7 +109,7 @@ export default function Webhooks(): JSX.Element {
|
|||
|
||||
async function onUpdate(): Promise<void> {
|
||||
const result = await setWebhookMutation({
|
||||
id: onEditId,
|
||||
id: onEditWebhook?.id,
|
||||
url,
|
||||
eventTypes,
|
||||
enabled: enabled,
|
||||
|
|
@ -151,11 +151,11 @@ export default function Webhooks(): JSX.Element {
|
|||
/>
|
||||
)}
|
||||
|
||||
{onEditId && (
|
||||
{onEditWebhook && (
|
||||
<FormModal
|
||||
title={'Edit webhook'}
|
||||
onSubmit={onUpdate}
|
||||
onOpenChange={() => setOnEditId('')}
|
||||
onOpenChange={() => setOnEditWebhook(null)}
|
||||
inputs={formInputs}
|
||||
acceptButtonLabel={'Update'}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue