diff options
author | Michael Greene <michael.greene@gmail.com> | 2016-04-05 13:04:11 -0500 |
---|---|---|
committer | Michael Greene <michael.greene@gmail.com> | 2016-04-13 12:04:09 -0500 |
commit | c1467f5d97c04c22e2119ace084bb016f8f53d48 (patch) | |
tree | b12c7210aa21f40917ae83dd635435e54e2c8519 /lib/api/notes.rb | |
parent | 28a7fe25fdf28042630282ace35e37310c8f0a12 (diff) | |
download | gitlab-ce-c1467f5d97c04c22e2119ace084bb016f8f53d48.tar.gz |
Allow back dating notes on creation
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 5 |
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? |