BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ef404d8e
Commit
ef404d8e
authored
Jan 11, 2014
by
Jeroen van Baarsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dropped expiration date from the snippet API
parent
2eb1220f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
6 deletions
+0
-6
project_snippets.md
doc/api/project_snippets.md
+0
-2
project_snippets.rb
lib/api/project_snippets.rb
+0
-4
No files found.
doc/api/project_snippets.md
View file @
ef404d8e
...
...
@@ -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
...
...
@@ -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
...
...
lib/api/project_snippets.rb
View file @
ef404d8e
...
...
@@ -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
...
...
@@ -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
...
...
@@ -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
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment