Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit fc12bf4

Browse files
author
vikasrohit
authored
Merge pull request #857 from appirio-tech/feature/submission-bughunt-fixes
-- Fixed issue which caused upload to fail after removing one of the …
2 parents bc605e9 + 5c86528 commit fc12bf4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/submissions/submit-design-files/submit-design-files.controller.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ import _ from 'lodash'
7676
}
7777

7878
function setFileReference(file, fieldId) {
79-
var fileObject = null
79+
var fileObject = {
80+
type: fieldId
81+
}
8082
if (file) {
8183
fileObject = {
8284
name: file.name,
@@ -93,8 +95,8 @@ import _ from 'lodash'
9395
var isFound = vm.submissionsBody.data.files.reduce(function(isFound, file, i, filesArray) {
9496
if (isFound) { return true }
9597

96-
if (file && file.type === fieldId) {
97-
// when file is removed, it would set correspding file as null
98+
// when file is removed, fileObject would have only type field
99+
if (file.type === fieldId) {
98100
filesArray[i] = fileObject
99101
return true
100102
}
@@ -103,7 +105,7 @@ import _ from 'lodash'
103105
}, false)
104106

105107
// Add new files to the list
106-
if (!isFound && fileObject) {
108+
if (!isFound) {
107109
vm.submissionsBody.data.files.push(fileObject)
108110
}
109111
}

0 commit comments

Comments
 (0)