feat:Update pnpm-lock.yaml to link shared package; modify API routes to utilize new schemas for domain and service management; enhance DNS record handling with CNAME support; refactor service and subdomain routes for improved functionality; implement confirm dialog for domain deletion in the frontend; clean up unused components and improve UI consistency.
Build, Test, and Push CFDM Docker Image / test (push) Failing after 51s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Build, Test, and Push CFDM Docker Image / test (push) Failing after 51s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
This commit is contained in:
1 parent
4a70cf5854
commit
6d1d8ca4f3
99 files changed
+6692
-1483
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import type { FastifyInstance } from "fastify";
|
||||
import { updateDomainSchema } from "@cfdm/shared";
|
||||
import { z } from "zod";
|
||||
import * as domainService from "../services/domain-service.js";
|
||||
|
||||
@@ -8,11 +9,6 @@ export async function domainRoutes(app: FastifyInstance) {
|
||||
group_id: z.number().nullable().optional(),
|
||||
});
|
||||
|
||||
const updateSchema = z.object({
|
||||
group_id: z.number().nullable().optional(),
|
||||
status: z.string().optional(),
|
||||
});
|
||||
|
||||
app.get("/domains", async (request) => {
|
||||
const query = request.query as { group_id?: string };
|
||||
const groupId = query.group_id ? Number(query.group_id) : undefined;
|
||||
@@ -36,13 +32,14 @@ export async function domainRoutes(app: FastifyInstance) {
|
||||
|
||||
app.patch("/domains/:id", async (request) => {
|
||||
const { id } = request.params as { id: string };
|
||||
const body = updateSchema.parse(request.body);
|
||||
const body = updateDomainSchema.parse(request.body);
|
||||
const existing = domainService.getDomain(request.server.db, Number(id));
|
||||
return domainService.updateDomain(
|
||||
request.server.db,
|
||||
Number(id),
|
||||
body.group_id !== undefined ? body.group_id : existing.group_id,
|
||||
body.status ?? existing.status,
|
||||
body.cert_monitoring,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user