* fix: avoided uncessary api call while creating issue draft (#6230)
* fix: fixed import order in module header
This commit is contained in:
parent
44d8de1169
commit
0a320a8540
2 changed files with 16 additions and 14 deletions
|
|
@ -187,19 +187,21 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
|
||||||
if (!response) throw new Error();
|
if (!response) throw new Error();
|
||||||
|
|
||||||
// check if we should add issue to cycle/module
|
// check if we should add issue to cycle/module
|
||||||
if (
|
if (!is_draft_issue) {
|
||||||
payload.cycle_id &&
|
if (
|
||||||
payload.cycle_id !== "" &&
|
payload.cycle_id &&
|
||||||
(payload.cycle_id !== cycleId || storeType !== EIssuesStoreType.CYCLE)
|
payload.cycle_id !== "" &&
|
||||||
) {
|
(payload.cycle_id !== cycleId || storeType !== EIssuesStoreType.CYCLE)
|
||||||
await addIssueToCycle(response, payload.cycle_id);
|
) {
|
||||||
}
|
await addIssueToCycle(response, payload.cycle_id);
|
||||||
if (
|
}
|
||||||
payload.module_ids &&
|
if (
|
||||||
payload.module_ids.length > 0 &&
|
payload.module_ids &&
|
||||||
(!payload.module_ids.includes(moduleId?.toString()) || storeType !== EIssuesStoreType.MODULE)
|
payload.module_ids.length > 0 &&
|
||||||
) {
|
(!payload.module_ids.includes(moduleId?.toString()) || storeType !== EIssuesStoreType.MODULE)
|
||||||
await addIssueToModule(response, payload.module_ids);
|
) {
|
||||||
|
await addIssueToModule(response, payload.module_ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add other property values
|
// add other property values
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,13 @@ import React, { FC, useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { ListFilter, Search, X } from "lucide-react";
|
import { ListFilter, Search, X } from "lucide-react";
|
||||||
// plane utils
|
|
||||||
// plane helpers
|
// plane helpers
|
||||||
import { useOutsideClickDetector } from "@plane/hooks";
|
import { useOutsideClickDetector } from "@plane/hooks";
|
||||||
// types
|
// types
|
||||||
import { TModuleFilters } from "@plane/types";
|
import { TModuleFilters } from "@plane/types";
|
||||||
// ui
|
// ui
|
||||||
import { Tooltip } from "@plane/ui";
|
import { Tooltip } from "@plane/ui";
|
||||||
|
// plane utils
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// components
|
// components
|
||||||
import { FiltersDropdown } from "@/components/issues";
|
import { FiltersDropdown } from "@/components/issues";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue