chore: module select handle logic updated

This commit is contained in:
Anmol Singh Bhatia 2024-02-21 15:34:27 +05:30
parent fcaac7e492
commit d4c2b4db10

View File

@ -36,8 +36,8 @@ export const IssueModuleSelect: React.FC<TIssueModuleSelect> = observer((props)
const handleIssueModuleChange = async (moduleIds: string[]) => {
if (!issue || !issue.module_ids) return;
setIsUpdating(true);
const updatedModuleId = xor(issue.module_ids, moduleIds)[0];
if (updatedModuleId !== undefined) {
const updatedModuleIds = xor(issue.module_ids, moduleIds);
for (const updatedModuleId of updatedModuleIds) {
if (issue.module_ids.includes(updatedModuleId)) {
await issueOperations.removeModulesFromIssue?.(workspaceSlug, projectId, issueId, [updatedModuleId]);
} else {