use callback

This commit is contained in:
Hongbo Wu 2024-03-25 22:03:32 +08:00
parent 592a759b8d
commit 051e6a2b56

View file

@ -41,13 +41,13 @@ export default function Notion(): JSX.Element {
})
}, [form, notion])
const deleteNotion = async () => {
const deleteNotion = useCallback(async () => {
await deleteIntegrationMutation(notion.id)
showSuccessToast('Notion integration disconnected successfully.')
revalidate()
router.push('/settings/integrations')
}
}, [notion.id, router])
const updateNotion = async (values: FieldType) => {
await setIntegrationMutation({