feat: Added get all users. closes #16
This commit is contained in:
parent
a0ea5ec191
commit
b17771755d
9
webv2/server/api/users/index.get.ts
Normal file
9
webv2/server/api/users/index.get.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export default defineEventHandler(async () => {
|
||||||
|
try {
|
||||||
|
return await UserModel.find()
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed to get users', e)
|
||||||
|
|
||||||
|
throw createError({ statusCode: 500, statusMessage: 'Failed to get users' })
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user