improvement: add organization name constraint

This commit is contained in:
Scott Wilson
2025-03-06 15:41:27 -08:00
parent 706feafbf2
commit abc2ffca57
7 changed files with 174 additions and 167 deletions
@@ -12,6 +12,7 @@ import {
import { ORGANIZATIONS } from "@app/lib/api-docs";
import { getConfig } from "@app/lib/config/env";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { OrganizationNameSchema } from "@app/server/lib/schemas";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { ActorType, AuthMode } from "@app/services/auth/auth-type";
@@ -330,7 +331,7 @@ export const registerOrgRouter = async (server: FastifyZodProvider) => {
},
schema: {
body: z.object({
name: z.string().trim()
name: OrganizationNameSchema
}),
response: {
200: z.object({