diff --git a/src/components/SettingForms/BearerType/BearerTypeFields.tsx b/src/components/SettingForms/BearerType/BearerTypeFields.tsx index 86586bd..b06dde3 100644 --- a/src/components/SettingForms/BearerType/BearerTypeFields.tsx +++ b/src/components/SettingForms/BearerType/BearerTypeFields.tsx @@ -24,8 +24,8 @@ const BearerTypeFields = () => { verbose: verbose === "true", }; - const handleSubmit = (values: BearerTypeFieldType) => { - dispatcherMutation.mutate(values); + const handleSubmit = async (values: BearerTypeFieldType) => { + await dispatcherMutation.mutateAsync(values); }; return ( @@ -34,37 +34,41 @@ const BearerTypeFields = () => { onSubmit={handleSubmit} enableReinitialize > -
-
- - - ( + +
+ + + + {options?.map((option: string) => ( + + ))} + + + +
+ + +
+
+ -
- + {isSubmitting || dispatcherMutation.isPending + ? "Saving..." + : "Save Changes"} + +
+ + )} ); }; diff --git a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx index c2d601b..387eec0 100644 --- a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx +++ b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx @@ -30,8 +30,8 @@ const ChannelFields = () => { readTimeoutSeconds: Number(readTimeoutSeconds), }; - const handleSubmit = (values: InitialValuesForm) => { - backOfficeMutation.mutate(values); + const handleSubmit = async (values: InitialValuesForm) => { + await backOfficeMutation.mutateAsync(values); }; const ValidationToastOnce = () => { @@ -84,7 +84,7 @@ const ChannelFields = () => { enableReinitialize validate={validateValues} > - {({ errors, touched }) => ( + {({ errors, touched, isSubmitting }) => (
@@ -172,7 +172,9 @@ const ChannelFields = () => { type="submit" className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full md:w-[50%]" > - Save Changes + {isSubmitting || backOfficeMutation.isPending + ? "Saving..." + : "Save Changes"}