[WEB-3953] fix: issue description assets upload when project id is switched (#6975)

This commit is contained in:
Prateek Shourya 2025-04-25 14:27:40 +05:30 committed by GitHub
parent 6df8323665
commit 546217f09b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View file

@ -683,7 +683,7 @@ class ProjectBulkAssetEndpoint(BaseAPIView):
# For some cases, the bulk api is called after the issue is deleted creating # For some cases, the bulk api is called after the issue is deleted creating
# an integrity error # an integrity error
try: try:
assets.update(issue_id=entity_id) assets.update(issue_id=entity_id, project_id=project_id)
except IntegrityError: except IntegrityError:
pass pass

View file

@ -132,10 +132,14 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
}; };
const addIssueToModule = async (issue: TIssue, moduleIds: string[]) => { 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, []); await Promise.all([
moduleIds.forEach((moduleId) => fetchModuleDetails(workspaceSlug.toString(), activeProjectId, moduleId)); 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) => { const handleCreateMoreToggleChange = (value: boolean) => {
@ -182,7 +186,7 @@ export const CreateUpdateIssueModalBase: React.FC<IssuesModalProps> = observer((
if (uploadedAssetIds.length > 0) { if (uploadedAssetIds.length > 0) {
await fileService.updateBulkProjectAssetsUploadStatus( await fileService.updateBulkProjectAssetsUploadStatus(
workspaceSlug?.toString() ?? "", workspaceSlug?.toString() ?? "",
activeProjectId ?? "", response?.project_id ?? "",
response?.id ?? "", response?.id ?? "",
{ {
asset_ids: uploadedAssetIds, asset_ids: uploadedAssetIds,