I am trying to build a plugin for Shopware6 along the lines of BundleExample & Storefinder and am stuck on creating the corresponding entries for my entities. I added a module to the admin which has 3 components: list, detail and create routed to [vendor-name].[plugin-name].list/.detail/.create respectively.
From custom\plugins[plugin-name]\src\Resources\administration\module[vendor-name]-[plugin-name]\index.js
routes:{
list:{
component: '[vendor-name]-[plugin-name]-list',
path: 'list'
},
detail:{
component: '[vendor-name]-[plugin-name]-detail',
path: 'detail/:id',
meta:{
parentPath: '[vendor-name].[plugin-name].list'
}
},
create:{
component: '[vendor-name]-[plugin-name]-create',
path: 'create',
meta:{
parentPath: '[vendor-name].[plugin-name].list'
}
}
/list is displayed as expected when there are no entries in the DB, meaning only the smartbar is visible. /detail cant work because there is no id since there are no entities yet. /create should generate an instance via
created(){
this.repository = this.repositoryFactory.create('[vendor-name]_[plugin-name]');
this.repository.create(this.context);
}
but nothing is happening.
I'm sure I'm overlooking a basic step somewhere and would appreciate any pointers as to how i can get it to actually generate an entry. If further code would be helpfull to clarify the question I will gladly provide it.