-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1669 from tryzealot/feat/update-app-build-api
[API] add edit, destroy build of app
- Loading branch information
Showing
18 changed files
with
830 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::ReleasesController < Api::BaseController | ||
before_action :validate_user_token | ||
before_action :set_release | ||
|
||
# UPDATE /releases/:id | ||
def update | ||
@release.update!(release_params) | ||
render json: @release | ||
end | ||
|
||
# DELETE /releases/:id | ||
def destroy | ||
@release.destroy | ||
render json: { mesage: 'OK' } | ||
end | ||
|
||
protected | ||
|
||
def set_release | ||
@release = Release.find(params[:id]) | ||
end | ||
|
||
def release_params | ||
params.permit( | ||
:release_version, :build_version, :release_type, :source, :branch, :git_commit, | ||
:ci_url, :custom_fields, :changelog | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'swagger_helper' | ||
|
||
RSpec.describe 'Releases API' do | ||
path '/releases/{id}' do | ||
put I18n.t('api.releases.update.title') do | ||
tags I18n.t('api.releases.default.tags') | ||
description I18n.t('api.releases.update.description') | ||
operationId 'updateRelease' | ||
|
||
include_examples :primary_key_parameter | ||
include_examples :request_body, '#/definitions/ReleaseOptions' | ||
|
||
produces 'application/json' | ||
response 200, I18n.t('api.releases.default.responses.show') do | ||
schema '$ref': '#/components/schemas/Release' | ||
run_test! | ||
end | ||
|
||
include_examples :unauthorized_response | ||
include_examples :not_found_response | ||
end | ||
end | ||
|
||
path '/releases/{id}' do | ||
delete I18n.t('api.releases.destroy.title') do | ||
tags I18n.t('api.releases.default.tags') | ||
description I18n.t('api.releases.destroy.description') | ||
operationId 'destroyRelease' | ||
|
||
include_examples :primary_key_parameter | ||
|
||
produces 'application/json' | ||
response 200, I18n.t('api.releases.default.responses.destroy') do | ||
schema '$ref': '#/components/responses/Destroyed' | ||
run_test! | ||
end | ||
|
||
include_examples :unauthorized_response | ||
include_examples :not_found_response | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.