fix: create issue modal bug

This commit is contained in:
Aaryan Khandelwal 2023-02-02 19:03:54 +05:30
parent 563921d0cf
commit 4f85773a48
3 changed files with 8 additions and 7 deletions

View File

@ -17,8 +17,6 @@ import useUser from "hooks/use-user";
import useToast from "hooks/use-toast";
// components
import { IssueForm } from "components/issues";
// common
import { renderDateFormat } from "helpers/date-time.helper";
// types
import type { IIssue, IssueResponse } from "types";
// fetch keys
@ -52,7 +50,10 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
const [activeProject, setActiveProject] = useState<string | null>(null);
const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug, projectId, cycleId, moduleId } = router.query;
if (cycleId) prePopulateData = { ...prePopulateData, cycle: cycleId as string };
if (moduleId) prePopulateData = { ...prePopulateData, module: moduleId as string };
const { user } = useUser();
const { setToastAlert } = useToast();

View File

@ -282,13 +282,13 @@ const SingleCycle: React.FC<UserAuth> = (props) => {
title="Create a new issue"
description="Click to create a new issue inside the cycle."
Icon={PlusIcon}
action={() => openCreateIssueModal()}
action={openCreateIssueModal}
/>
<EmptySpaceItem
title="Add an existing issue"
description="Open list"
Icon={ListBulletIcon}
action={() => openIssuesListModal()}
action={openIssuesListModal}
/>
</EmptySpace>
</div>

View File

@ -303,13 +303,13 @@ const SingleModule: React.FC<UserAuth> = (props) => {
title="Create a new issue"
description="Click to create a new issue inside the module."
Icon={PlusIcon}
action={() => openCreateIssueModal()}
action={openCreateIssueModal}
/>
<EmptySpaceItem
title="Add an existing issue"
description="Open list"
Icon={ListBulletIcon}
action={() => openIssuesListModal()}
action={openIssuesListModal}
/>
</EmptySpace>
</div>