fixes model property not being set on browse.entity controller
import Route from '@ember/routing/route';
-import { set } from '@ember/object';
+import { setProperties } from '@ember/object';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
import { refreshModelQueryParams } from 'wherehows-web/utils/helpers/routes';
import EntityController from 'wherehows-web/controllers/browse/entity';
@@ -22,10 +22,9 @@ export interface IBrowserRouteParams {
export default class extends Route.extend(AuthenticatedRouteMixin) {
queryParams = refreshModelQueryParams(queryParamsKeys);
- setupController(controller: EntityController, { entity }: IBrowserRouteParams) {
- this._super(...arguments);
- // sets the entity property on the controller
- set(controller, 'entity', entity);
+ setupController(controller: EntityController, model: IBrowserRouteParams) {
+ // sets the entity property on the controller in addition to the model
+ setProperties(controller, { entity: model.entity, model });
}
model(params: IBrowserRouteParams): IBrowserRouteParams {
