Am I allowed to add a catch
method in my model
hook? i.e. something like this:
model(params) {
return this.store.findRecord('shop', params.slug)
.catch( () =>
this.transitionTo('welcome.shops.index'))
}
}
My goal is to route the user whenever he entered the incorrect slug
. If there is a better approach to my desire behaviour please suggest it. Would appreciate any help, thanks.