<commit_before>import Ember from 'ember';

export default Ember.Route.extend({
  userEvents: Ember.inject.service(),
  schoolEvents: Ember.inject.service(),
  model(params){
    let slug = params.slug;
    let container = slug.substring(0, 1);
    let service;
    if(container === 'S'){
      service = this.get('schoolEvents');
    }
    if(container === 'U'){
      service = this.get('userEvents');
    }
    
    return service.getEventForSlug(slug);
  }<commit_msg>refactored events route use authn route mixin.<commit_after>import Ember from "ember";
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

const { Route, inject } = Ember;
const { service } = inject;

export default Route.extend(AuthenticatedRouteMixin, {

  userEvents: service(),
  schoolEvents: service(),
  model(params){
    let slug = params.slug;
    let container = slug.substring(0, 1);
    let service;
    if(container === 'S'){
      service = this.get('schoolEvents');
    }
    if(container === 'U'){
      service = this.get('userEvents');
    }
    
    return service.getEventForSlug(slug);
  }
{'fraction_non_alphanumeric': 0.14183764495985726, 'fraction_numerical': 0.003568242640499554, 'mean_word_length': 3.5795918367346937, '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': '6232659', 'n_tokens_mistral': 359, 'n_tokens_neox': 353, 'n_words': 79}