Show LABEL_ADDED in the webhooks table

This commit is contained in:
Hongbo Wu 2023-03-10 09:56:10 +08:00
parent a85bc721c3
commit f357be51be

View file

@ -52,7 +52,10 @@ export default function Webhooks(): JSX.Element {
webhooks.forEach((webhook) =>
rows.set(webhook.id, {
url: webhook.url,
eventTypes: webhook.eventTypes.join(', '),
eventTypes: eventTypeOptions
.filter((option) => webhook.eventTypes.includes(option.value))
.map((option) => option.label)
.join(', '),
method: webhook.method,
contentType: webhook.contentType,
})
@ -198,7 +201,7 @@ export default function Webhooks(): JSX.Element {
label: 'Event Types',
name: 'eventTypes',
value: eventTypeOptions.map((option) =>
webhook?.eventTypes.includes(option.value)
webhook?.eventTypes.includes(option.label)
),
onChange: setEventTypes,
options: eventTypeOptions,