Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
6 deletions
+0
-6
doc/api/project_snippets.md
doc/api/project_snippets.md
+0
-2
lib/api/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:
...
@@ -57,7 +57,6 @@ Parameters:
+
`id`
(required) - The ID of a project
+
`id`
(required) - The ID of a project
+
`title`
(required) - The title of a snippet
+
`title`
(required) - The title of a snippet
+
`file_name`
(required) - The name of a snippet file
+
`file_name`
(required) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(required) - The content of a snippet
+
`code`
(required) - The content of a snippet
...
@@ -75,7 +74,6 @@ Parameters:
...
@@ -75,7 +74,6 @@ Parameters:
+
`snippet_id`
(required) - The ID of a project's snippet
+
`snippet_id`
(required) - The ID of a project's snippet
+
`title`
(optional) - The title of a snippet
+
`title`
(optional) - The title of a snippet
+
`file_name`
(optional) - The name of a snippet file
+
`file_name`
(optional) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(optional) - The content of a snippet
+
`code`
(optional) - The content of a snippet
...
...
lib/api/project_snippets.rb
View file @
ef404d8e
...
@@ -41,7 +41,6 @@ module API
...
@@ -41,7 +41,6 @@ module API
# id (required) - The ID of a project
# id (required) - The ID of a project
# title (required) - The title of a snippet
# title (required) - The title of a snippet
# file_name (required) - The name of a snippet file
# file_name (required) - The name of a snippet file
# lifetime (optional) - The expiration date of a snippet
# code (required) - The content of a snippet
# code (required) - The content of a snippet
# Example Request:
# Example Request:
# POST /projects/:id/snippets
# POST /projects/:id/snippets
...
@@ -50,7 +49,6 @@ module API
...
@@ -50,7 +49,6 @@ module API
required_attributes!
[
:title
,
:file_name
,
:code
]
required_attributes!
[
:title
,
:file_name
,
:code
]
attrs
=
attributes_for_keys
[
:title
,
:file_name
]
attrs
=
attributes_for_keys
[
:title
,
:file_name
]
attrs
[
:expires_at
]
=
params
[
:lifetime
]
if
params
[
:lifetime
].
present?
attrs
[
:content
]
=
params
[
:code
]
if
params
[
:code
].
present?
attrs
[
:content
]
=
params
[
:code
]
if
params
[
:code
].
present?
@snippet
=
user_project
.
snippets
.
new
attrs
@snippet
=
user_project
.
snippets
.
new
attrs
@snippet
.
author
=
current_user
@snippet
.
author
=
current_user
...
@@ -69,7 +67,6 @@ module API
...
@@ -69,7 +67,6 @@ module API
# snippet_id (required) - The ID of a project snippet
# snippet_id (required) - The ID of a project snippet
# title (optional) - The title of a snippet
# title (optional) - The title of a snippet
# file_name (optional) - The name of a snippet file
# file_name (optional) - The name of a snippet file
# lifetime (optional) - The expiration date of a snippet
# code (optional) - The content of a snippet
# code (optional) - The content of a snippet
# Example Request:
# Example Request:
# PUT /projects/:id/snippets/:snippet_id
# PUT /projects/:id/snippets/:snippet_id
...
@@ -78,7 +75,6 @@ module API
...
@@ -78,7 +75,6 @@ module API
authorize!
:modify_project_snippet
,
@snippet
authorize!
:modify_project_snippet
,
@snippet
attrs
=
attributes_for_keys
[
:title
,
:file_name
]
attrs
=
attributes_for_keys
[
:title
,
:file_name
]
attrs
[
:expires_at
]
=
params
[
:lifetime
]
if
params
[
:lifetime
].
present?
attrs
[
:content
]
=
params
[
:code
]
if
params
[
:code
].
present?
attrs
[
:content
]
=
params
[
:code
]
if
params
[
:code
].
present?
if
@snippet
.
update_attributes
attrs
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