Skip to content

Commit 77bb9ff

Browse files
authored
Merge pull request #445 from mschmo/keyword-not-found
Handle keyword not found by flashing message
2 parents 0f3adf3 + ccf3f63 commit 77bb9ff

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/routes/keyword.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Route.extend({
4+
model(params) {
5+
return this.store.find('keyword', params.keyword_id).catch(e => {
6+
if (e.errors.any(e => e.detail === 'Not Found')) {
7+
this.controllerFor('application').set('flashError', `Keyword '${params.keyword_id}' does not exist`);
8+
}
9+
});
10+
}
11+
});

app/templates/keyword/error.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ title 'Keyword Not Found' }}

0 commit comments

Comments
 (0)