summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-16 19:55:14 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-16 19:55:14 +0200
commit065e0c0fe4e5e16b90c01736721e4c794b71dac9 (patch)
tree1638aeeb23e60cd1d2c33a99b1d875ebb3620942 /lib/api/notes.rb
parent5117412e33821f8eaf50befd2e00e431bfc74738 (diff)
parent05920a7964a039fd65d6b665c2ebd130d5ef949c (diff)
downloadgitlab-ce-065e0c0fe4e5e16b90c01736721e4c794b71dac9.tar.gz
Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts: # db/schema.rb
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?