Snake case -> camel case for backend -> frontend entity types conversion

This commit is contained in:
Fabio Manganiello 2022-10-30 11:01:46 +01:00
parent 691d109fb7
commit 78dc8416fb
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -26,10 +26,15 @@ export default {
},
mounted() {
if (this.type !== 'Entity')
if (this.type !== 'Entity') {
const type = this.type.split('_').map((t) =>
t[0].toUpperCase() + t.slice(1)
).join('')
this.component = defineAsyncComponent(
() => import(`@/components/panels/Entities/${this.type}`)
() => import(`@/components/panels/Entities/${type}`)
)
}
},
}
</script>