diff --git a/frontend/src/pages/admin/AdminContent/index.tsx b/frontend/src/pages/admin/AdminContent/index.tsx index 37d36c9f..7ae479b0 100644 --- a/frontend/src/pages/admin/AdminContent/index.tsx +++ b/frontend/src/pages/admin/AdminContent/index.tsx @@ -4,6 +4,8 @@ import { Button, ToggleButton, ToggleButtonGroup } from "@mui/material"; import { useContext, useEffect, useState } from "react"; import "twin.macro"; +import { useNavigate } from "react-router-dom"; + import { doDeleteOrg, putOrgLogo } from "api"; import { FetchError } from "api/api"; import { Modal } from "components"; @@ -54,6 +56,8 @@ const AdminContent = ({ orgName = "..."; } + const navigate = useNavigate(); + const [windowSelected, setWindowSelected] = useState("campaigns"); const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [showEditDialog, setShowEditDialog] = useState(false); @@ -188,7 +192,7 @@ const AdminContent = ({ diff --git a/frontend/src/pages/create_campaign/index.tsx b/frontend/src/pages/create_campaign/index.tsx index 5adfb637..7f31f666 100644 --- a/frontend/src/pages/create_campaign/index.tsx +++ b/frontend/src/pages/create_campaign/index.tsx @@ -234,6 +234,7 @@ const CreateCampaign = () => { questionsSend ); await setCampaignCoverImage(campaignId, cover); + navigate("/admin"); } catch (err) { if (err instanceof FetchError) { try {