feat(pref): better form for Komga conf

This commit is contained in:
Julien Froidefond
2025-02-24 21:34:13 +01:00
parent 4c12356225
commit e80c26136a
3 changed files with 146 additions and 91 deletions

View File

@@ -1,14 +1,14 @@
import { NextResponse } from "next/server";
import { TestService } from "@/lib/services/test.service";
import { ConfigDBService } from "@/lib/services/config-db.service";
export async function POST() {
export async function POST(request: Request) {
try {
const config = await ConfigDBService.getConfig();
const { serverUrl, username, password } = await request.json();
const authHeader = Buffer.from(`${username}:${password}`).toString("base64");
const { libraries } = await TestService.testConnection({
serverUrl: config.url,
authHeader: config.authHeader,
serverUrl,
authHeader,
});
return NextResponse.json({