import settings from '../../settings';


export class SearchController {
  constructor($log, $state, SessionService) {
    'ngInject';

    this.queryParams = SessionService.queryParams;
    this.searchTypes = settings.MEDIA_TYPES;
    Object.assign(this, {$log, $state});
  }

  search(queryParams) {
    queryParams = queryParams || {term: undefined};
    this.$state.go('search', queryParams);
  }
}


export class ResultsController {
  constructor($log, $scope, $state, response) {
    'ngInject';

    $log.debug('Search response: ', response);

    Object.assign(this, {$log, $state, response});
  }

  get showResults() {
    return Boolean(this.$state.params.term);
  }
}

@@ -299,22 +299,23 @@
 ) %7B%0A    
-queryP
+const p
 arams = 
@@ -330,16 +330,23 @@
 ams %7C%7C %7B
+%0A      
 term: un
@@ -352,16 +352,57 @@
 ndefined
+, media: settings.DEFAULT_MEDIA_TYPE%0A    
 %7D;%0A    t
@@ -425,22 +425,17 @@
 earch', 
-queryP
+p
 arams);%0A

Reset media type as well