Polarcraft/web/server/api/team/unaffiliated.js

8 lines
241 B
JavaScript
Raw Normal View History

2023-05-09 13:57:01 +02:00
export default defineEventHandler(async (event) => {
const usersColl = db.collection('users')
const cursor = usersColl.find({ team: { $exists: false } })
const unaffiliatedUsers = await cursor.toArray()
return unaffiliatedUsers
});