Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Greene <michael.greene@gmail.com>2016-04-05 21:04:11 +0300
committerMichael Greene <michael.greene@gmail.com>2016-04-13 20:04:09 +0300
commitc1467f5d97c04c22e2119ace084bb016f8f53d48 (patch)
treeb12c7210aa21f40917ae83dd635435e54e2c8519 /lib/api/notes.rb
parent28a7fe25fdf28042630282ace35e37310c8f0a12 (diff)
Allow back dating notes on creation
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index a1c98f5e8ff..71a53e6f0d6 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -61,6 +61,7 @@ module API
# id (required) - The ID of a project
# noteable_id (required) - The ID of an issue or snippet
# body (required) - The content of a note
+ # created_at (optional) - The date
# Example Request:
# POST /projects/:id/issues/:noteable_id/notes
# POST /projects/:id/snippets/:noteable_id/notes
@@ -73,6 +74,10 @@ module API
noteable_id: params[noteable_id_str]
}
+ if params[:created_at] && (current_user.is_admin? || user_project.owner == current_user)
+ opts[:created_at] = params[:created_at]
+ end
+
@note = ::Notes::CreateService.new(user_project, current_user, opts).execute
if @note.valid?