File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/console/src/pages/Security/Captcha Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useContext, useState } from 'react';
3
3
import { FormProvider , useForm } from 'react-hook-form' ;
4
4
import { toast } from 'react-hot-toast' ;
5
5
import { useTranslation } from 'react-i18next' ;
6
+ import { useSWRConfig } from 'swr' ;
6
7
7
8
import Plus from '@/assets/icons/plus.svg?react' ;
8
9
import DetailsForm from '@/components/DetailsForm' ;
@@ -45,6 +46,8 @@ function CaptchaForm({ captchaProvider, formData }: Props) {
45
46
} = formMethods ;
46
47
const api = useApi ( ) ;
47
48
49
+ const { mutate : mutateGlobal } = useSWRConfig ( ) ;
50
+
48
51
const onSubmit = trySubmitSafe ( async ( data : CaptchaPolicy ) => {
49
52
const { captchaPolicy } = await api
50
53
. patch ( 'api/sign-in-exp' , {
@@ -53,6 +56,9 @@ function CaptchaForm({ captchaProvider, formData }: Props) {
53
56
. json < SignInExperience > ( ) ;
54
57
reset ( captchaPolicy ) ;
55
58
mutateSubscriptionQuotaAndUsages ( ) ;
59
+
60
+ // Global mutate the SIE data
61
+ await mutateGlobal ( 'api/sign-in-exp' ) ;
56
62
toast . success ( t ( 'general.saved' ) ) ;
57
63
} ) ;
58
64
You can’t perform that action at this time.
0 commit comments