diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 12:03:50 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 12:03:50 +0400 |
commit | 3bab1bd4c162239dcf582a82360cf94d4953ef69 (patch) | |
tree | 8fa6edb9dd9ebc7dbf40dfe59abf9b0fb4251831 /lib/api/files.rb | |
parent | 33eae33423d224e10a3a9aeefd70d632d70b20fe (diff) |
Improve consistency: use file_path for API create/update/delete files
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r-- | lib/api/files.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb index 588c27d5692..6a5419a580f 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -8,8 +8,7 @@ module API # Create new file in repository # # Parameters: - # file_name (required) - The name of new file. Ex. class.rb - # file_path (optional) - The path to new file. Ex. lib/ + # file_path (optional) - The path to new file. Ex. lib/class.rb # branch_name (required) - The name of branch # content (required) - File content # commit_message (required) - Commit message @@ -18,8 +17,8 @@ module API # POST /projects/:id/repository/files # post ":id/repository/files" do - required_attributes! [:file_name, :branch_name, :content, :commit_message] - attrs = attributes_for_keys [:file_name, :file_path, :branch_name, :content, :commit_message] + required_attributes! [:file_path, :branch_name, :content, :commit_message] + attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message] branch_name = attrs.delete(:branch_name) file_path = attrs.delete(:file_path) result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute @@ -28,7 +27,6 @@ module API status(201) { - file_name: attrs[:file_name], file_path: file_path, branch_name: branch_name } |