Skip to content

Commit

Permalink
update submission_params to permit all the submission agent attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jul 24, 2023
1 parent 4cae0e6 commit 9fdcbed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/controllers/concerns/submission_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ def submission_params(params)
end
end

p[:hasCreator] = p[:hasCreator].map(&:values).flatten.uniq if p[:hasCreator]
p[:publisher] = p[:publisher].map(&:values).flatten.uniq if p[:publisher]
@metadata.each do |m|
m_attr = m['attribute'].to_sym
if p[m_attr] && m['enforce'].include?('list')
p[m_attr] = Array(p[m_attr]) unless p[m_attr].is_a?(Array)
p[m_attr] = p[m_attr].map { |x| x.is_a?(Hash) ? x.values : x }.flatten.uniq if m['enforce'].include?('Agent')
end
end

p
end
end

0 comments on commit 9fdcbed

Please sign in to comment.