13 lines
197 B
TypeScript
13 lines
197 B
TypeScript
|
export default defineEventHandler(async (event) => {
|
||
|
const { name, color } = await readBody(event)
|
||
|
|
||
|
const team = new TeamModel({
|
||
|
name,
|
||
|
color
|
||
|
})
|
||
|
|
||
|
await team.save()
|
||
|
|
||
|
return team
|
||
|
})
|