Polarcraft/webv2/server/api/users/index.get.ts
Xeovalyte b17771755d
All checks were successful
Build and Deploy / Deploy Web (push) Successful in 1m2s
Build and Deploy / Deploy Discord Bot (push) Successful in 42s
feat: Added get all users. closes #16
2023-06-05 09:34:22 +02:00

10 lines
239 B
TypeScript

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' })
}
})