Commit ef404d8ea62f277ec40d9a0a82c08d389b07b54e
1 parent
2eb1220f
Exists in
spb-stable
and in
3 other branches
Dropped expiration date from the snippet API
Showing
2 changed files
with
0 additions
and
6 deletions
Show diff stats
doc/api/project_snippets.md
... | ... | @@ -57,7 +57,6 @@ Parameters: |
57 | 57 | + `id` (required) - The ID of a project |
58 | 58 | + `title` (required) - The title of a snippet |
59 | 59 | + `file_name` (required) - The name of a snippet file |
60 | -+ `lifetime` (optional) - The expiration date of a snippet | |
61 | 60 | + `code` (required) - The content of a snippet |
62 | 61 | |
63 | 62 | |
... | ... | @@ -75,7 +74,6 @@ Parameters: |
75 | 74 | + `snippet_id` (required) - The ID of a project's snippet |
76 | 75 | + `title` (optional) - The title of a snippet |
77 | 76 | + `file_name` (optional) - The name of a snippet file |
78 | -+ `lifetime` (optional) - The expiration date of a snippet | |
79 | 77 | + `code` (optional) - The content of a snippet |
80 | 78 | |
81 | 79 | ... | ... |
lib/api/project_snippets.rb
... | ... | @@ -41,7 +41,6 @@ module API |
41 | 41 | # id (required) - The ID of a project |
42 | 42 | # title (required) - The title of a snippet |
43 | 43 | # file_name (required) - The name of a snippet file |
44 | - # lifetime (optional) - The expiration date of a snippet | |
45 | 44 | # code (required) - The content of a snippet |
46 | 45 | # Example Request: |
47 | 46 | # POST /projects/:id/snippets |
... | ... | @@ -50,7 +49,6 @@ module API |
50 | 49 | required_attributes! [:title, :file_name, :code] |
51 | 50 | |
52 | 51 | attrs = attributes_for_keys [:title, :file_name] |
53 | - attrs[:expires_at] = params[:lifetime] if params[:lifetime].present? | |
54 | 52 | attrs[:content] = params[:code] if params[:code].present? |
55 | 53 | @snippet = user_project.snippets.new attrs |
56 | 54 | @snippet.author = current_user |
... | ... | @@ -69,7 +67,6 @@ module API |
69 | 67 | # snippet_id (required) - The ID of a project snippet |
70 | 68 | # title (optional) - The title of a snippet |
71 | 69 | # file_name (optional) - The name of a snippet file |
72 | - # lifetime (optional) - The expiration date of a snippet | |
73 | 70 | # code (optional) - The content of a snippet |
74 | 71 | # Example Request: |
75 | 72 | # PUT /projects/:id/snippets/:snippet_id |
... | ... | @@ -78,7 +75,6 @@ module API |
78 | 75 | authorize! :modify_project_snippet, @snippet |
79 | 76 | |
80 | 77 | attrs = attributes_for_keys [:title, :file_name] |
81 | - attrs[:expires_at] = params[:lifetime] if params[:lifetime].present? | |
82 | 78 | attrs[:content] = params[:code] if params[:code].present? |
83 | 79 | |
84 | 80 | if @snippet.update_attributes attrs | ... | ... |