11 lines
264 B
JavaScript
11 lines
264 B
JavaScript
|
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
|
||
|
});
|