first fixes
Build & Deploy / build (push) Failing after 28s
Build & Deploy / docker (push) Has been skipped

This commit is contained in:
Kevin
2026-06-29 23:15:45 +02:00
parent 3721b98420
commit 75bf7c205a
19 changed files with 50 additions and 56 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ export default class ComponentsController {
async index({ inertia, auth }: HttpContext) {
const user = await auth.authenticate()
const components = await Component.query().preload('type').where('userId', user.id)
return inertia.render('components/index', { components: components.map((c) => c.serialize()) })
return inertia.render('components/index', { components: components.map((c) => c.serialize({ relations: true })) })
}
async create({ inertia }: HttpContext) {
@@ -40,7 +40,7 @@ export default class ComponentsController {
.where('userId', user.id)
.andWhere('id', componentId)
.firstOrFail()
return inertia.render('components/show', { component: component.serialize() })
return inertia.render('components/show', { component: component.serialize({ relations: true }) })
}
async edit({ params, auth, inertia }: HttpContext) {
@@ -53,7 +53,7 @@ export default class ComponentsController {
.andWhere('id', componentId)
.firstOrFail()
return inertia.render('components/edit', {
component: component.serialize(),
component: component.serialize({ relations: true }),
types: types.map((t) => t.serialize()),
})
}