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

11 lines
264 B
JavaScript
Raw Normal View History

2023-05-09 13:57:01 +02:00
import { ObjectId } from 'mongodb'
export default defineEventHandler(async (event) => {
const user = await getAuth(event)
const teamsColl = db.collection('teams')
const team = await teamsColl.findOne({ _id: new ObjectId(user.team.id) })
return team
});