mirror of
https://github.com/supabase/supabase.git
synced 2026-06-08 02:25:04 +08:00
Replace ui setnotification with toast part 2 (#21872)
* Replace ui setnotification with toast part 2 * Prettier lint
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
||||
import { useParams } from 'common'
|
||||
import { useEffect, useState } from 'react'
|
||||
import toast from 'react-hot-toast'
|
||||
import {
|
||||
AlertDescription_Shadcn_,
|
||||
AlertTitle_Shadcn_,
|
||||
@@ -28,7 +29,7 @@ import UpgradeToPro from 'components/ui/UpgradeToPro'
|
||||
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
|
||||
import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'
|
||||
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
|
||||
import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks'
|
||||
import { useCheckPermissions, useSelectedOrganization } from 'hooks'
|
||||
import { IS_PLATFORM } from 'lib/constants'
|
||||
import FormField from '../AuthProvidersForm/FormField'
|
||||
|
||||
@@ -74,7 +75,6 @@ function HoursOrNeverText({ value }: { value: number }) {
|
||||
const formId = 'auth-config-basic-settings'
|
||||
|
||||
const BasicAuthSettingsForm = () => {
|
||||
const { ui } = useStore()
|
||||
const { ref: projectRef } = useParams()
|
||||
const {
|
||||
data: authConfig,
|
||||
@@ -127,16 +127,10 @@ const BasicAuthSettingsForm = () => {
|
||||
{ projectRef: projectRef!, config: payload },
|
||||
{
|
||||
onError: (error) => {
|
||||
ui.setNotification({
|
||||
category: 'error',
|
||||
message: `Failed to update settings: ${error?.message}`,
|
||||
})
|
||||
toast.error(`Failed to update settings: ${error?.message}`)
|
||||
},
|
||||
onSuccess: () => {
|
||||
ui.setNotification({
|
||||
category: 'success',
|
||||
message: `Successfully updated settings`,
|
||||
})
|
||||
toast.success(`Successfully updated settings`)
|
||||
resetForm({ values: values, initialValues: values })
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user