show user first impl.
This commit is contained in:
@@ -24,7 +24,15 @@ export default class UsersController {
|
||||
|
||||
public async store({}: HttpContextContract) {}
|
||||
|
||||
public async show({}: HttpContextContract) {}
|
||||
public async show({ bouncer, params, inertia }: HttpContextContract) {
|
||||
const queriedUser: User = await User.findByOrFail('id', params.id)
|
||||
|
||||
await bouncer
|
||||
.with('UserPolicy')
|
||||
.authorize('show', queriedUser)
|
||||
|
||||
return inertia.render('Users/Show', { queriedUser })
|
||||
}
|
||||
|
||||
public async edit({}: HttpContextContract) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user