refactor to use new settings return type
This commit is contained in:
1 parent
2f93b70d7f
commit
fc655e7711
5 files changed
+57
-49
No files matched your search
@@ -3,7 +3,7 @@ import { networkService } from "../main";
|
||||
import { createToast } from "../Utils/toastUtils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const useFetchSettings = ({ setSettings }) => {
|
||||
const useFetchSettings = ({ setSettingsData }) => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState(undefined);
|
||||
useEffect(() => {
|
||||
@@ -11,7 +11,7 @@ const useFetchSettings = ({ setSettings }) => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await networkService.getAppSettings();
|
||||
setSettings(response?.data?.data);
|
||||
setSettingsData(response?.data?.data);
|
||||
} catch (error) {
|
||||
createToast({ body: "Failed to fetch settings" });
|
||||
setError(error);
|
||||
|
||||
Reference in new issue
Block a user