fix: TS errors, serialize calls, unused imports, pre-commit hook
This commit is contained in:
@@ -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({ relations: true })) })
|
||||
return inertia.render('components/index', { components: components.map((c) => c.serialize()) })
|
||||
}
|
||||
|
||||
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({ relations: true }) })
|
||||
return inertia.render('components/show', { component: component.serialize() })
|
||||
}
|
||||
|
||||
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({ relations: true }),
|
||||
component: component.serialize(),
|
||||
types: types.map((t) => t.serialize()),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user