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

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

Document update action no longer requires an ID parameter
Document update action no longer requires an ID parameter

Also included more informational messages after executing.
