<commit_before>class ApiV1Controller < ApplicationController
  def variants
    scoped_variants = if params[:detailed_view]
                        @display_detailed_view = true
                        Variant.show_scope
                      else
                        Variant.index_scope
                      end
    @variants = Filter.filter_query(scoped_variants, params)

    respond_to do |format|
      format.json
      format.tsv
      format.vcf
    end
  end

  def variant
    @variant = Variant.show_scope.where(hgvs: params[:hgvs]).first!
  end
end<commit_msg>include feedback when a variant is not found. Fixes #33<commit_after>class ApiV1Controller < ApplicationController
  def variants
    scoped_variants = if params[:detailed_view]
                        @display_detailed_view = true
                        Variant.show_scope
                      else
                        Variant.index_scope
                      end
    @variants = Filter.filter_query(scoped_variants, params)

    respond_to do |format|
      format.json
      format.tsv
      format.vcf
    end
  end

  def variant
    hgvs = params[:hgvs]
    @variant = Variant.show_scope.where(hgvs: hgvs).first
    unless @variant
      render json: { errors: [ "No variant with HGVS #{hgvs} found in DoCM" ] }, status: :not_found
    end
  end
end
{'fraction_non_alphanumeric': 0.06497386109036594, 'fraction_numerical': 0.002987303958177745, 'mean_word_length': 1.851063829787234, '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': '111548', 'n_tokens_mistral': 393, 'n_tokens_neox': 366, 'n_words': 90}