<commit_before>Yossarian.EventsRoute = Ember.Route.extend
  loadData: (controller, callback) ->
    $.ajax
      type: 'POST'
      url: '/api/v1/events/search'
      data:
        q: controller.get('query')
        tags: controller.get('selectedTags')
        countries: controller.get('selectedCountries')
        page: controller.get('currentPage')
      success: (data) =>
        @store.unloadAll('event')
        @store.pushPayload('event', data)

        controller.set('content', @store.all('event'))
        callback?()

  setupController: (controller) ->
    @loadData(controller)

  actions:
    reload: (callback) ->
      controller = @controllerFor('events')

      @loadData(controller, callback)<commit_msg>Find events by id in store<commit_after>Yossarian.EventsRoute = Ember.Route.extend
  loadData: (controller, callback) ->
    $.ajax
      type: 'POST'
      url: '/api/v1/events/search'
      data:
        q: controller.get('query')
        tags: controller.get('selectedTags')
        countries: controller.get('selectedCountries')
        page: controller.get('currentPage')
      success: (data) =>
        @store.pushPayload('event', data)

        events = data.events.map (event) => @store.getById('event', event.id)

        controller.set('content', events)

        callback?()

  setupController: (controller) ->
    @loadData(controller)

  actions:
    reload: (callback) ->
      controller = @controllerFor('events')

      @loadData(controller, callback)
{'fraction_non_alphanumeric': 0.14544235924932977, 'fraction_numerical': 0.0013404825737265416, 'mean_word_length': 2.9083769633507854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '974327', 'n_tokens_mistral': 437, 'n_tokens_neox': 425, 'n_words': 82}