From df7ed9eef2048c9a2f79860e00a69f84fa92e10e Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 2 Jan 2019 19:56:03 +0900 Subject: Add unique constraint to release and url Fix coding style Improve coding style Decouple UPDATE and DELETE operations of asset links Rename links_attributes to assets:links Rename exposed param and updated spec --- lib/api/releases.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lib/api') diff --git a/lib/api/releases.rb b/lib/api/releases.rb index 63c755f3620..c3d4101528c 100644 --- a/lib/api/releases.rb +++ b/lib/api/releases.rb @@ -49,9 +49,11 @@ module API requires :name, type: String, desc: 'The name of the release' requires :description, type: String, desc: 'The release notes' optional :ref, type: String, desc: 'The commit sha or branch name' - optional :links_attributes, type: Array do - requires :name, type: String - requires :url, type: String + optional :assets, type: Hash do + optional :links, type: Array do + requires :name, type: String + requires :url, type: String + end end end post ':id/releases' do @@ -76,13 +78,6 @@ module API requires :tag_name, type: String, desc: 'The name of the tag', as: :tag optional :name, type: String, desc: 'The name of the release' optional :description, type: String, desc: 'Release notes with markdown support' - optional :links_attributes, type: Array do - optional :id, type: Integer - optional :name, type: String - optional :url, type: String - optional :_destroy, type: Integer - at_least_one_of :name, :url, :_destroy - end end put ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do authorize_update_release! -- cgit v1.2.3