Skip to content
Snippets Groups Projects
Commit ef404d8e authored by Jeroen van Baarsen's avatar Jeroen van Baarsen
Browse files

Dropped expiration date from the snippet API

parent 2eb1220f
No related branches found
No related tags found
1 merge request!6027Removed expiration from snippets
Loading
Loading
@@ -57,7 +57,6 @@ Parameters:
+ `id` (required) - The ID of a project
+ `title` (required) - The title of a snippet
+ `file_name` (required) - The name of a snippet file
+ `lifetime` (optional) - The expiration date of a snippet
+ `code` (required) - The content of a snippet
 
 
Loading
Loading
@@ -75,7 +74,6 @@ Parameters:
+ `snippet_id` (required) - The ID of a project's snippet
+ `title` (optional) - The title of a snippet
+ `file_name` (optional) - The name of a snippet file
+ `lifetime` (optional) - The expiration date of a snippet
+ `code` (optional) - The content of a snippet
 
 
Loading
Loading
Loading
Loading
@@ -41,7 +41,6 @@ module API
# id (required) - The ID of a project
# title (required) - The title of a snippet
# file_name (required) - The name of a snippet file
# lifetime (optional) - The expiration date of a snippet
# code (required) - The content of a snippet
# Example Request:
# POST /projects/:id/snippets
Loading
Loading
@@ -50,7 +49,6 @@ module API
required_attributes! [:title, :file_name, :code]
 
attrs = attributes_for_keys [:title, :file_name]
attrs[:expires_at] = params[:lifetime] if params[:lifetime].present?
attrs[:content] = params[:code] if params[:code].present?
@snippet = user_project.snippets.new attrs
@snippet.author = current_user
Loading
Loading
@@ -69,7 +67,6 @@ module API
# snippet_id (required) - The ID of a project snippet
# title (optional) - The title of a snippet
# file_name (optional) - The name of a snippet file
# lifetime (optional) - The expiration date of a snippet
# code (optional) - The content of a snippet
# Example Request:
# PUT /projects/:id/snippets/:snippet_id
Loading
Loading
@@ -78,7 +75,6 @@ module API
authorize! :modify_project_snippet, @snippet
 
attrs = attributes_for_keys [:title, :file_name]
attrs[:expires_at] = params[:lifetime] if params[:lifetime].present?
attrs[:content] = params[:code] if params[:code].present?
 
if @snippet.update_attributes attrs
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment