Skip to content

Commit

Permalink
Redirect to error if type is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent99 committed Jan 15, 2021
1 parent 0311ef1 commit 6dd8cb7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/ResourceList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export default {
let hasFetch = false;
const inStore = store.getters['currentProduct'].inStore;
const schema = store.getters[`${ inStore }/schemaFor`](resource);
if ( !schema ) {
store.dispatch('loadingError', `Type ${ resource } not found`);
return;
}
if ( this.hasListComponent ) {
// If you provide your own list then call its asyncData
const importer = store.getters['type-map/importList'](resource);
Expand All @@ -33,8 +42,6 @@ export default {
}
if ( !hasFetch ) {
const inStore = store.getters['currentProduct'].inStore;
this.rows = await store.dispatch(`${ inStore }/findAll`, { type: resource });
}
},
Expand Down

0 comments on commit 6dd8cb7

Please sign in to comment.