mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
Feat: User Session History
This commit is contained in:
1 parent
dc972173a4
commit
a71411d5bf
9 files changed
+92
-19
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import Pagination from '../models/pagination.ts'
|
||||
import { userList } from '../models/users.js'
|
||||
import { userList, userDetail, idToUser } from '../models/users.js'
|
||||
|
||||
export async function userListController(req: any, res: any) {
|
||||
const { nextKey, order } = req.query
|
||||
@@ -20,3 +20,14 @@ export async function userListController(req: any, res: any) {
|
||||
res.status(500).send('Error fetching user data')
|
||||
}
|
||||
}
|
||||
export async function userDetailController(req: any, res: any) {
|
||||
const { id } = req.params
|
||||
const sessions = await userDetail(id)
|
||||
try {
|
||||
const user = await idToUser(id)
|
||||
res.render('usersDetail', { sessions, user })
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
res.status(500).send('Error fetching user data')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user