const {
isLoading,
error,
isSuccess,
mutate: createClient,
} = trpc.client.create.useMutation()
const onSubmit: SubmitHandler<CreateClientInput> = async (data) => {
createClient(data)
if (isSuccess) {
toast.success('Success.')
// router.push('/clients')
}
if (error) toast.error('An error occured.')
}
const {
isLoading,
error,
isSuccess,
mutate: createClient,
} = trpc.client.create.useMutation()
const onSubmit: SubmitHandler<CreateClientInput> = async (data) => {
createClient(data)
if (isSuccess) {
toast.success('Success.')
// router.push('/clients')
}
if (error) toast.error('An error occured.')
}