Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
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
Expand Up @@ -76,7 +76,9 @@ import _ from 'lodash'
}

function setFileReference(file, fieldId) {
var fileObject = null
var fileObject = {
type: fieldId
}
if (file) {
fileObject = {
name: file.name,
Expand All @@ -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
}
Expand All @@ -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)
}
}
Expand Down