mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 14:19:11 +03:00
add success and failure toasts
This commit is contained in:
1 parent
1fc297a21e
commit
a4275ac150
1 file changed
+5
@@ -4,6 +4,7 @@ import { ChevronDown, ExternalLink } from 'lucide-react'
|
||||
import { type SubmitHandler, useForm } from 'react-hook-form'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { z } from 'zod'
|
||||
import { toast } from 'sonner'
|
||||
import {
|
||||
Button,
|
||||
DialogFooter,
|
||||
@@ -54,9 +55,13 @@ const NewAccessTokenButton = ({ onCreateToken }: NewAccessTokenButtonProps) => {
|
||||
{ name: values.tokenName, scope: tokenScope },
|
||||
{
|
||||
onSuccess: (data) => {
|
||||
toast.success(`Your access token "${data.name}" is ready.`)
|
||||
onCreateToken(data)
|
||||
setVisible(false)
|
||||
},
|
||||
onError: () => {
|
||||
toast.error(`Failed to create access token.`)
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user