]> git.openstreetmap.org Git - rails.git/commitdiff
Allow a comment to be supplied when hiding a note
authorTom Hughes <tom@compton.nu>
Mon, 8 Apr 2013 20:29:41 +0000 (21:29 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 8 Apr 2013 20:29:41 +0000 (21:29 +0100)
app/controllers/notes_controller.rb

index db963820363014b107722937ed5ae444e2409614..e79be2e8d31b4605ccaebff60c2a3ca5fa644c42 100644 (file)
@@ -195,6 +195,7 @@ class NotesController < ApplicationController
 
     # Extract the arguments
     id = params[:id].to_i
+    comment = params[:text]
 
     # Find the note and check it is valid
     note = Note.find(id)
@@ -206,7 +207,7 @@ class NotesController < ApplicationController
       note.status = "hidden"
       note.save
 
-      add_comment(note, nil, "hidden")
+      add_comment(note, comment, "hidden")
     end
 
     # Render the result