Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m14s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 1m50s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 7s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
Subpath @cfdm/db/settings-repo и @cfdm/db/repos не объявлены в package exports — в Docker/vitest падали 5 test suites. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
680 B
TypeScript
23 lines
680 B
TypeScript
import type { FastifyInstance } from "fastify";
|
|
import { appSettingsPatchSchema } from "@cfdm/shared";
|
|
import {
|
|
getAppSettings,
|
|
updateAppSettings,
|
|
} from "@cfdm/db";
|
|
import { pingVpsTracker } from "../services/vps-tracker-sync.js";
|
|
|
|
export async function settingsRoutes(app: FastifyInstance) {
|
|
app.get("/settings", async (request) => {
|
|
return getAppSettings(request.server.db);
|
|
});
|
|
|
|
app.patch("/settings", async (request) => {
|
|
const body = appSettingsPatchSchema.parse(request.body);
|
|
return updateAppSettings(request.server.db, body);
|
|
});
|
|
|
|
app.post("/settings/vps-tracker/test", async (request) => {
|
|
return pingVpsTracker(request.server.db);
|
|
});
|
|
}
|