working on userform

This commit is contained in:
Sockenklaus
2023-07-11 22:28:58 +02:00
parent 428ab06fcc
commit 3a85d2c196
8 changed files with 134 additions and 35 deletions

View File

@@ -6,20 +6,20 @@ export default class UsersController {
public async index({ inertia, bouncer }: HttpContextContract) {
await bouncer.with('UserPolicy').authorize('index')
const users = await Database
const users = await Database
.from('users')
.select('id', 'username', 'is_admin')
return inertia.render('Users/Index', { users })
}
public async create({ auth, inertia }: HttpContextContract) {
if(auth.user?.isAdmin) {
inertia.render('Users/Create')
} else {
}
public async create({ inertia, bouncer }: HttpContextContract) {
await bouncer
.with('UserPolicy')
.authorize('create')
return inertia.render('Users/Create')
}
public async store({}: HttpContextContract) {}