[WEB-3953] fix: issue description assets upload when project id is switched (#6975)
This commit is contained in:
parent
6df8323665
commit
546217f09b
2 changed files with 9 additions and 5 deletions
|
|
@ -683,7 +683,7 @@ class ProjectBulkAssetEndpoint(BaseAPIView):
|
|||
# For some cases, the bulk api is called after the issue is deleted creating
|
||||
# an integrity error
|
||||
try:
|
||||
assets.update(issue_id=entity_id)
|
||||
assets.update(issue_id=entity_id, project_id=project_id)
|
||||
except IntegrityError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,14 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
|
|||
};
|
||||
|
||||
const addIssueToModule = async (issue: TIssue, moduleIds: string[]) => {
|
||||
if (!workspaceSlug || !activeProjectId) return;
|
||||
if (!workspaceSlug || !issue.project_id) return;
|
||||
|
||||
await issues.changeModulesInIssue(workspaceSlug.toString(), activeProjectId, issue.id, moduleIds, []);
|
||||
moduleIds.forEach((moduleId) => fetchModuleDetails(workspaceSlug.toString(), activeProjectId, moduleId));
|
||||
await Promise.all([
|
||||
issues.changeModulesInIssue(workspaceSlug.toString(), issue.project_id, issue.id, moduleIds, []),
|
||||
...moduleIds.map(
|
||||
(moduleId) => issue.project_id && fetchModuleDetails(workspaceSlug.toString(), issue.project_id, moduleId)
|
||||
),
|
||||
]);
|
||||
};
|
||||
|
||||
const handleCreateMoreToggleChange = (value: boolean) => {
|
||||
|
|
@ -182,7 +186,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
|
|||
if (uploadedAssetIds.length > 0) {
|
||||
await fileService.updateBulkProjectAssetsUploadStatus(
|
||||
workspaceSlug?.toString() ?? "",
|
||||
activeProjectId ?? "",
|
||||
response?.project_id ?? "",
|
||||
response?.id ?? "",
|
||||
{
|
||||
asset_ids: uploadedAssetIds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue