Commit 4f2e9fb8e56249d3bcce128a50a6fa6b4deca00f

Authored by Dmitriy Zaporozhets
1 parent 7001ad2d

Accept encoding attribute in files API

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
lib/api/files.rb
@@ -18,7 +18,7 @@ module API @@ -18,7 +18,7 @@ module API
18 # 18 #
19 post ":id/repository/files" do 19 post ":id/repository/files" do
20 required_attributes! [:file_path, :branch_name, :content, :commit_message] 20 required_attributes! [:file_path, :branch_name, :content, :commit_message]
21 - attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message] 21 + attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding]
22 branch_name = attrs.delete(:branch_name) 22 branch_name = attrs.delete(:branch_name)
23 file_path = attrs.delete(:file_path) 23 file_path = attrs.delete(:file_path)
24 result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute 24 result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute
@@ -48,7 +48,7 @@ module API @@ -48,7 +48,7 @@ module API
48 # 48 #
49 put ":id/repository/files" do 49 put ":id/repository/files" do
50 required_attributes! [:file_path, :branch_name, :content, :commit_message] 50 required_attributes! [:file_path, :branch_name, :content, :commit_message]
51 - attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message] 51 + attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding]
52 branch_name = attrs.delete(:branch_name) 52 branch_name = attrs.delete(:branch_name)
53 file_path = attrs.delete(:file_path) 53 file_path = attrs.delete(:file_path)
54 result = ::Files::UpdateContext.new(user_project, current_user, attrs, branch_name, file_path).execute 54 result = ::Files::UpdateContext.new(user_project, current_user, attrs, branch_name, file_path).execute