diff --git a/app/pages/cif/project-revision/[projectRevision]/form/contacts.tsx b/app/pages/cif/project-revision/[projectRevision]/form/contacts.tsx index e41c7d53c3..7f07c4ca12 100644 --- a/app/pages/cif/project-revision/[projectRevision]/form/contacts.tsx +++ b/app/pages/cif/project-revision/[projectRevision]/form/contacts.tsx @@ -1,20 +1,21 @@ +import { Button } from "@button-inc/bcgov-theme"; +import ProjectContactForm from "components/Form/ProjectContactForm"; +import ProjectContactFormSummary from "components/Form/ProjectContactFormSummary"; import DefaultLayout from "components/Layout/DefaultLayout"; -import { withRelay, RelayProps } from "relay-nextjs"; -import { graphql, usePreloadedQuery } from "react-relay/hooks"; -import { contactsFormQuery } from "__generated__/contactsFormQuery.graphql"; +import TaskList from "components/TaskList"; +import useRedirectTo404IfFalsy from "hooks/useRedirectTo404IfFalsy"; +import useRedirectToLatestRevision from "hooks/useRedirectToLatestRevision"; import withRelayOptions from "lib/relay/withRelayOptions"; +import { useCreateProjectRevision } from "mutations/ProjectRevision/createProjectRevision"; import { useRouter } from "next/router"; import { - getProjectRevisionPageRoute, getProjectRevisionContactsFormPageRoute, + getProjectRevisionPageRoute, + getProjectRevisionQuarterlyReportsFormPageRoute, } from "pageRoutes"; -import { useCreateProjectRevision } from "mutations/ProjectRevision/createProjectRevision"; -import ProjectContactForm from "components/Form/ProjectContactForm"; -import TaskList from "components/TaskList"; -import useRedirectTo404IfFalsy from "hooks/useRedirectTo404IfFalsy"; -import useRedirectToLatestRevision from "hooks/useRedirectToLatestRevision"; -import ProjectContactFormSummary from "components/Form/ProjectContactFormSummary"; -import { Button } from "@button-inc/bcgov-theme"; +import { graphql, usePreloadedQuery } from "react-relay/hooks"; +import { RelayProps, withRelay } from "relay-nextjs"; +import { contactsFormQuery } from "__generated__/contactsFormQuery.graphql"; const pageQuery = graphql` query contactsFormQuery($projectRevision: ID!) { @@ -53,6 +54,8 @@ export function ProjectContactsPage({ : query.projectRevision.changeStatus === "committed" ? "view" : "edit"; + const existingRevision = + query.projectRevision?.projectByProjectId?.pendingProjectRevision ?? null; const [createProjectRevision, isCreatingProjectRevision] = useCreateProjectRevision(); @@ -88,8 +91,6 @@ export function ProjectContactsPage({ }; const createEditButton = () => { - const existingRevision = - query.projectRevision.projectByProjectId.pendingProjectRevision; return (