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:
authorValery Sizov <vsv2711@gmail.com>2015-11-19 19:12:17 +0300
committerValery Sizov <vsv2711@gmail.com>2015-11-19 19:12:17 +0300
commitbdf4007cb7b18ed6892455d0a9adf78476188563 (patch)
treed9db5467ff74c4387777e15a9f0a0bbee6f3e81a /app/controllers/projects/notes_controller.rb
parent671a49cfd53230b57acf579a609bab958e066982 (diff)
adressing comments
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r--app/controllers/projects/notes_controller.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index 8159cc50838..263b8b8d94e 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -59,21 +59,21 @@ class Projects::NotesController < Projects::ApplicationController
end
def award_toggle
- noteable = params[:noteable_type] == "Issue" ? Issue : MergeRequest
- noteable = noteable.find(params[:noteable_id])
+ noteable = note_params[:noteable_type] == "issue" ? Issue : MergeRequest
+ noteable = noteable.find_by!(id: note_params[:noteable_id], project: project)
+
data = {
- noteable: noteable,
author: current_user,
is_award: true,
- note: params[:emoji]
+ note: note_params[:note]
}
- note = project.notes.find_by(data)
+ note = noteable.notes.find_by(data)
if note
note.destroy
else
- project.notes.create(data)
+ Notes::CreateService.new(project, current_user, note_params).execute
end
render json: { ok: true }