<commit_before>import Ember from 'ember';
import $ from 'jquery';

export default Ember.Mixin.create({
  queryParams: {
    filter: { refreshModel: true },
    page: { refreshModel: true },
    size: { refreshModel: true },
    sort: { refreshModel: true }
  },
  mergedQueryOptions: {},
  model(params) {
    const options = {
      filter: params.filter,
      sort: params.sort,
      page: {
        number: params.page,
        size: params.size
      }
    };
    $.extend(options, this.get('mergedQueryOptions'));
    return this.store.query(this.get('modelName'), options);
  }
});<commit_msg>Add filter param to the route mixin<commit_after>import Ember from 'ember';
import $ from 'jquery';

export default Ember.Mixin.create({
  queryParams: {
    filter: { refreshModel: true },
    page: { refreshModel: true },
    size: { refreshModel: true },
    sort: { refreshModel: true }
  },
  mergedQueryOptions: {},
  model(params) {
    const options = {
      sort: params.sort,
      page: {
        number: params.page,
        size: params.size
      }
    };
    // TODO: sending an empty filter param to backend returns []
    if (params.filter) { options['filter'] = params.filter; }
    $.extend(options, this.get('mergedQueryOptions'));
    return this.store.query(this.get('modelName'), options);
  }
});
{'fraction_non_alphanumeric': 0.1437216338880484, 'fraction_numerical': 0.0, 'mean_word_length': 2.9375, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4513942', 'n_tokens_mistral': 401, 'n_tokens_neox': 398, 'n_words': 99}