put -> patch
This commit is contained in:
1 parent
3838b18931
commit
2e30b622d3
1 file changed
+3
-3
@@ -27,7 +27,7 @@ import {
|
|||||||
import SettingsStats from "./SettingsStats.jsx";
|
import SettingsStats from "./SettingsStats.jsx";
|
||||||
|
|
||||||
import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
||||||
import { useGet, usePost, useDelete, useLazyGet, usePut } from "@/Hooks/UseApi";
|
import { useGet, usePost, useDelete, useLazyGet, usePatch } from "@/Hooks/UseApi";
|
||||||
// Constants
|
// Constants
|
||||||
const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }];
|
const BREADCRUMBS = [{ name: `Settings`, path: "/settings" }];
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@ const Settings = () => {
|
|||||||
}
|
}
|
||||||
}, [fetchedSettings]);
|
}, [fetchedSettings]);
|
||||||
|
|
||||||
const { put: saveSettingsFn, loading: isSaving } = usePut();
|
const { patch: saveSettingsFn, loading: isSaving } = usePatch();
|
||||||
|
|
||||||
const saveSettings = async (settings) => {
|
const saveSettings = async (settings) => {
|
||||||
const response = await saveSettingsFn("/settings", { settings });
|
const response = await saveSettingsFn("/settings", settings);
|
||||||
if (response?.data) {
|
if (response?.data) {
|
||||||
const data = response.data;
|
const data = response.data;
|
||||||
setIsApiKeySet(data.pagespeedKeySet);
|
setIsApiKeySet(data.pagespeedKeySet);
|
||||||
|
|||||||
Reference in new issue
Block a user