Commit 4f2e9fb8e56249d3bcce128a50a6fa6b4deca00f
1 parent
7001ad2d
Exists in
spb-stable
and in
3 other branches
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 | 18 | # |
19 | 19 | post ":id/repository/files" do |
20 | 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 | 22 | branch_name = attrs.delete(:branch_name) |
23 | 23 | file_path = attrs.delete(:file_path) |
24 | 24 | result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute |
... | ... | @@ -48,7 +48,7 @@ module API |
48 | 48 | # |
49 | 49 | put ":id/repository/files" do |
50 | 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 | 52 | branch_name = attrs.delete(:branch_name) |
53 | 53 | file_path = attrs.delete(:file_path) |
54 | 54 | result = ::Files::UpdateContext.new(user_project, current_user, attrs, branch_name, file_path).execute | ... | ... |