mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-31 12:48:03 +00:00
Improve domain creation and update flexibility by allowing optional provider ID.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/b8028253-9393-4805-8293-3b06d95ed5e3.jpg
This commit is contained in:
+10
-1
@@ -215,7 +215,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
try {
|
||||
// Use id as string without parsing to int
|
||||
const id = req.params.id;
|
||||
const validatedData = insertDomainSchema.partial().parse(req.body);
|
||||
|
||||
// Create custom validation schema with optional providerId
|
||||
const domainUpdateSchema = z.object({
|
||||
name: z.string().optional(),
|
||||
organizationId: z.string().uuid().optional(),
|
||||
providerId: z.string().uuid().optional().nullable(),
|
||||
isActive: z.boolean().optional()
|
||||
});
|
||||
|
||||
const validatedData = domainUpdateSchema.parse(req.body);
|
||||
|
||||
const updatedDomain = await storage.updateDomain(id, validatedData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user