Set default enabled=false

This commit is contained in:
Hongbo Wu 2022-06-02 12:46:31 +08:00
parent 29797829b4
commit c18b41f184
2 changed files with 3 additions and 7 deletions

View file

@ -18,10 +18,6 @@ interface WebhookData {
}
export function useGetWebhookQuery(id: string): WebhookQueryResponse {
if (!id) {
return {}
}
const query = gql`
query GetWebhook($id: ID!) {
webhook(id: $id) {

View file

@ -24,7 +24,7 @@ export default function Webhooks(): JSX.Element {
'PAGE_CREATED',
'HIGHLIGHT_CREATED',
])
const [enabled, setEnabled] = useState(true)
const [enabled, setEnabled] = useState(false)
const [formInputs, setFormInputs] = useState<FormInputProps[]>([
{
label: 'URL',
@ -61,7 +61,7 @@ export default function Webhooks(): JSX.Element {
label: 'Event Types',
name: 'eventTypes',
disabled: true,
value: eventTypes.join(', '),
value: webhook.eventTypes.join(', '),
},
{
label: 'Enabled',
@ -102,7 +102,7 @@ export default function Webhooks(): JSX.Element {
id: onEditId,
url,
eventTypes,
enabled: enabled || false,
enabled: enabled,
})
if (result) {
showSuccessToast('Updated', { position: 'bottom-right' })