<commit_before>class Api::V1::DocumentsController < ApplicationController
  # PATCH/PUT /documents/1
  # PATCH/PUT /documents/1.json
  def update
    document = Document.find_by(id: params[:id])

    if not document.nil?
      document.update_document(params, document.documentID, @@tvVaultID, @@tvAdminAPI)
    end
  end

  private

    def document_params
      params.require(:document).permit(:documentID, :documentData)
    end
end<commit_msg>Document update action no longer requires an ID parameter<commit_after>class Api::V1::DocumentsController < ApplicationController
  # PATCH/PUT /documents/1
  # PATCH/PUT /documents/1.json
  
  def update
    document = current_user.document

    if not document.nil?
      doc = document.update_document(document_params, document.documentID, @@tvVaultID, @@tvAdminAPI)
      render json: {
                      status: 'success',
                      data:   doc.as_json
                    }
    else
      render json: {
                      status: 'error',
                      message: 'Document does not exist!'
                    }
    end
  end

  private

    def document_params
      params.except(:format, :controller, :action)
    end
end
{'fraction_non_alphanumeric': 0.09045643153526971, 'fraction_numerical': 0.004979253112033195, 'mean_word_length': 2.368715083798883, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '969431', 'n_tokens_mistral': 351, 'n_tokens_neox': 330, 'n_words': 80}