add conditon to hook for create/update

This commit is contained in:
Alex Holliday
2025-02-05 10:57:15 -08:00
parent 4e5833c09c
commit 73df0837bb
@@ -3,7 +3,7 @@ import { networkService } from "../../../../main";
import { useSelector } from "react-redux";
import { createToast } from "../../../../Utils/toastUtils";
const useCreateStatusPage = () => {
const useCreateStatusPage = (isCreate) => {
const { authToken, user } = useSelector((state) => state.auth);
const [isLoading, setIsLoading] = useState(false);
@@ -11,7 +11,7 @@ const useCreateStatusPage = () => {
const createStatusPage = async ({ form }) => {
setIsLoading(true);
try {
await networkService.createStatusPage({ authToken, user, form });
await networkService.createStatusPage({ authToken, user, form, isCreate });
return true;
} catch (error) {
setNetworkError(true);