feat: Added team joining

This commit is contained in:
2023-06-07 22:29:18 +02:00
parent 70b0b86a23
commit d1f08e3dfa
2 changed files with 31 additions and 0 deletions

View File

@@ -3,6 +3,10 @@ export default defineEventHandler(async (event) => {
const userId: string = event.context.params ? event.context.params.id : '@me'
if (userId === '@me') {
throw createError({ statusCode: 400, statusMessage: 'Cannot invite current user to a team' })
}
const user = await getUser(userId, event)
const { teamInvites } = await UserModel.findByIdAndUpdate(user._id, {