Commit 8c4adeec by liyijie

fix: 修复import_headers app: nil 空的问题

parent d54d8892
......@@ -137,14 +137,14 @@ module TalltyImportExport
def import_headers_result
if @headers.present?
headers_hash = @headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
import_headers.select do |_header|
import_headers(**context.params.symbolize_keys).select do |_header|
_header.with_indifferent_access[:key].to_s.in?(headers_hash.keys)
end.map do |_header|
_header = _header.with_indifferent_access
_header.merge(headers_hash[_header[:key]].delete_if { |k, v| v.blank? })
end
else
@headers = import_headers
@headers = import_headers(**options.symbolize_keys)
end
rescue
@headers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment