feat: Added team invite creation

This commit is contained in:
2023-06-06 22:28:26 +02:00
parent f9c13e5ada
commit 70b0b86a23
4 changed files with 22 additions and 2 deletions

View File

@@ -3,6 +3,11 @@ export default defineEventHandler(async (event) => {
if (teamId === '@current') {
const user = await getUser('@me', event)
if (!user.team) {
throw createError({ statusCode: 400, statusMessage: 'User must be in a team' })
}
teamId = user.team._id.toString()
}