Polarcraft/webv2/server/api/users/[id]/teamInvites.get.ts
Xeovalyte fbcd0d1bb9
Some checks failed
Build and Deploy / Deploy Web (push) Failing after 1s
Build and Deploy / Deploy Discord Bot (push) Failing after 1s
feat: Added team page
2023-06-24 13:27:33 +02:00

10 lines
289 B
TypeScript

export default defineEventHandler(async (event) => {
const userId: string = event.context.params ? event.context.params.id : '@me'
const user = await getUser(userId, event)
const { teamInvites } = await UserModel.findById(user._id).populate('teamInvites')
return teamInvites
})