aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/api_controller.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-09-07 12:51:42 +0100
committerRobin Houston <robin.houston@gmail.com>2012-09-07 12:51:42 +0100
commitc690679f5e55d908a0f91b0d9b3276ae3f748b2d (patch)
treecbe46b2e859aa6f59d39a110d997274091004a24 /app/controllers/api_controller.rb
parent67a3a43cc26f8ad7218f33a13af04c3c74347866 (diff)
parentdd39dbc580b1447758a6d3b9231ce09c9b3dcdf3 (diff)
Merge branch 'wdtk' of git.mysociety.org:/data/git/public/alaveteli into wdtk
Diffstat (limited to 'app/controllers/api_controller.rb')
-rw-r--r--app/controllers/api_controller.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index a7853c787..718c31e6f 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -71,18 +71,10 @@ class ApiController < ApplicationController
end
- def _get_attachments_from_params(params)
- attachments = []
- params.each_pair do |k, v|
- attachments << v if v.is_a? Tempfile
- end
- return attachments
- end
-
def add_correspondence
request = InfoRequest.find(params[:id])
json = ActiveSupport::JSON.decode(params[:correspondence_json])
- attachments = _get_attachments_from_params(params)
+ attachments = params[:attachments]
direction = json["direction"]
body = json["body"]
@@ -155,6 +147,7 @@ class ApiController < ApplicationController
:filename => filename
)
end
+
mail = RequestMailer.create_external_response(request, body, sent_at, attachment_hashes)
request.receive(mail, mail.encoded, true)
end