Initial Commit

This commit is contained in:
2026-10-03 20:07:49 +02:00
commit a1346c98b1
427 changed files with 59320 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import { z } from 'zod'
const bodySchema = z.object({
name: z.string().trim().min(2).max(50).regex(/^[\w-]+$/, 'Nur Buchstaben, Zahlen, - und _'),
})
export default defineEventHandler(async (event) => {
await requirePermission(event, 'roles.manage')
const { name } = await readValidatedBody(event, bodySchema.parse)
const id = await ensureRole(name)
return { id, name }
})