diff --git a/app/controllers/api/doctrine/annotations_controller.rb b/app/controllers/api/doctrine/annotations_controller.rb index 654d3ab..a2aaaee 100644 --- a/app/controllers/api/doctrine/annotations_controller.rb +++ b/app/controllers/api/doctrine/annotations_controller.rb @@ -81,7 +81,7 @@ module Api private def resource_params - params.permit(:document_id, :phil_rep, :editor_notes, :rank, annomark_ids: []) + params.permit(:document_id, :content, :phil_rep, :editor_notes, :rank, annomark_ids: []) end def search_params diff --git a/app/javascript/controllers/annotations_controller.js b/app/javascript/controllers/annotations_controller.js index 67f1156..7129d6f 100644 --- a/app/javascript/controllers/annotations_controller.js +++ b/app/javascript/controllers/annotations_controller.js @@ -19,7 +19,6 @@ export default class extends ApplicationController { var $this = this, annotation_id = $this.element.dataset["annotationId"], doctrine_id = $this.element.dataset["doctrineId"], document_title = "", document_ref_no = "", document_date_or_year = "", $modal = $("#annotationModal") - console.log($this.element.dataset["currentDocumentId"]) $modal.find("#current_document_id").val($this.element.dataset["currentDocumentId"]) if(annotation_id !== null && annotation_id !== undefined && annotation_id !== "") { $modal.find(".modal-title").text("Edit Annotation") @@ -74,7 +73,7 @@ export default class extends ApplicationController { current_document_id = $this.current_document_idTarget.value, doctrine_id = $this.doctrine_idTarget.value const params = { annomark_ids: $modal.find("select[name='annomark_ids[]']").val(), document_id: $this.document_idTarget.value, document_ids: $this.document_idsTarget.value || "", phil_rep: $this.phil_repTarget.value || "", - editor_notes: $this.editor_notesTarget.value || "" } + editor_notes: $this.editor_notesTarget.value || "", content: $modal.find("#document_title").val() } if (annotation_id !== null && annotation_id !== undefined && annotation_id !== "") { $.ajax({ diff --git a/db/migrate/20220307043427_add_content_in_annotation.rb b/db/migrate/20220307043427_add_content_in_annotation.rb new file mode 100644 index 0000000..ac45a3e --- /dev/null +++ b/db/migrate/20220307043427_add_content_in_annotation.rb @@ -0,0 +1,5 @@ +class AddContentInAnnotation < ActiveRecord::Migration[6.1] + def change + add_column :annotations, :content, :text, default: "", null: false + end +end