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

-- Fixed issue which caused upload to fail after removing one of the … #857

Merged
merged 1 commit into from
Jul 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -76,7 +76,9 @@ import _ from 'lodash'
}

function setFileReference(file, fieldId) {
var fileObject = null
var fileObject = {
type: fieldId
}
if (file) {
fileObject = {
name: file.name,
@@ -93,8 +95,8 @@ import _ from 'lodash'
var isFound = vm.submissionsBody.data.files.reduce(function(isFound, file, i, filesArray) {
if (isFound) { return true }

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

// Add new files to the list
if (!isFound && fileObject) {
if (!isFound) {
vm.submissionsBody.data.files.push(fileObject)
}
}