Add JSON exporter for user profile download

This commit is contained in:
James Kiesel
2014-12-08 21:58:11 +13:00
parent e25a48cc1c
commit e174514d69
18 changed files with 152 additions and 175 deletions

View File

@@ -136,8 +136,11 @@ class UsersController < ApplicationController
end
def export
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
send_data exporter.execute(current_user), :filename => "#{current_user.username}_diaspora_data.xml", :type => :xml
if export = Diaspora::Exporter.new(current_user).execute
send_data export, filename: "#{current_user.username}_diaspora_data.json", type: :json
else
head :not_acceptable
end
end
def export_photos