feat: Added team creation, closes #22
This commit is contained in:
12
webv2/server/api/teams/index.post.ts
Normal file
12
webv2/server/api/teams/index.post.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { name, color } = await readBody(event)
|
||||
|
||||
const team = new TeamModel({
|
||||
name,
|
||||
color
|
||||
})
|
||||
|
||||
await team.save()
|
||||
|
||||
return team
|
||||
})
|
Reference in New Issue
Block a user