<commit_before><template>
    <div>
        <input v-model="searchValue" type="search" id="game_search" name="game_search" class="u-full-width" placeholder="Zoeken" @keyup="searchGame"/>
        <datalist></datalist>
    </div>
</template>

<script>
    export default{
        data:function(){
            return{
                searchValue: "",
                searchResult:[],
            }
        },
        methods:{
            searchGame:function(){
                var base = this;

                var xhr = new XMLHttpRequest();
                xhr.open("POST", "/api/product/search");

                // The RequestHeader can be any, by the server accepted, file
                xhr.setRequestHeader('Content-type', "Application/JSON", true);

                // Function to fire off when the server has send a response
                xhr.onload = function () {
                    this.searchValue = JSON.parse(xhr.response);
                    console.log(this.searchValue);
                };

                xhr.send(JSON.stringify({value: this.searchValue}));
            }
        }
    }
</script><commit_msg>make autocomplete visible<commit_after><template>
    <div>
        <input v-model="searchValue" list="GameSearchList" type="search" id="game_search" name="game_search" class="u-full-width" placeholder="Zoeken" @keyup="searchGame"/>
        <datalist id="GameSearchList" v-for="game in searchResult">
            <option :value="game.GameTitle"></option>
        </datalist>
    </div>
</template>

<script>
    export default{
        data:function(){
            return{
                searchValue: "",
                searchResult:[],
            }
        },
        methods:{
            searchGame:function(){
                var base = this;

                var xhr = new XMLHttpRequest();
                xhr.open("POST", "/api/product/search");

                // The RequestHeader can be any, by the server accepted, file
                xhr.setRequestHeader('Content-type', "Application/JSON", true);

                // Function to fire off when the server has send a response
                xhr.onload = function () {
                    base.searchResult = JSON.parse(xhr.response);
                    console.log(base.searchResult);
                };

                xhr.send(JSON.stringify({value: this.searchValue}));
            }
        }
    }
</script>
{'fraction_non_alphanumeric': 0.1267605633802817, 'fraction_numerical': 0.0, 'mean_word_length': 1.6538461538461537, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '2000774', 'n_tokens_mistral': 653, 'n_tokens_neox': 619, 'n_words': 135}