Commit fcc86c15 authored by Rajendra Kadam's avatar Rajendra Kadam

Add intial code for create mirror api

parent 1c6e59fa
......@@ -26,6 +26,24 @@ module API
with: Entities::RemoteMirror
end
desc 'Create remote mirror for a project' do
success Entities::RemoteMirror
end
params do
requries :url, type: String, desc: 'The URL for a remote mirror'
end
post ':id/remote_mirrors' do
create_params = declared_params(include_missing: false)
new_mirror = user_project.remote_mirrors.create(create_params)
if new_mirror.persisted?
present new_mirror, with: Entities::RemoteMirror
else
render_validation_error!(new_mirror)
end
end
desc 'Update the attributes of a single remote mirror' do
success Entities::RemoteMirror
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment