Skip to content

Commit

Permalink
feat: refressh page when changing engagementstate
Browse files Browse the repository at this point in the history
  • Loading branch information
TrymVei committed Jun 13, 2024
1 parent d6f6011 commit 1a68e8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/components/ChangeEngagementState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@/api-types";
import { useState } from "react";
import FilterButton from "./Buttons/FilterButton";
import { usePathname } from "next/navigation";
import { usePathname, useRouter } from "next/navigation";

export default function ChangeEngagementState({
project,
Expand All @@ -16,6 +16,8 @@ export default function ChangeEngagementState({
}) {
const organisationName = usePathname().split("/")[1];

const router = useRouter();

const [engagementState, setEngagementState] = useState<EngagementState>(
project.bookingType,
);
Expand All @@ -39,6 +41,7 @@ export default function ChangeEngagementState({
};

await submitAddEngagementForm(body);
router.refresh();
}

async function submitAddEngagementForm(body: UpdateProjectWriteModel) {
Expand Down

0 comments on commit 1a68e8c

Please sign in to comment.