Files
9router/src/app/api/settings/route.js
T
Catalin StanciuandClaude Sonnet 4.5 9ebd7d3062 feat: add round-robin routing strategy
Implements a round-robin (least recently used) account selection strategy
alongside the existing fill-first priority system. Adds a toggle in the
Profile dashboard to switch between strategies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 17:25:28 +07:00

24 lines
703 B
JavaScript

import { NextResponse } from "next/server";
import { getSettings, updateSettings } from "@/lib/localDb";
export async function GET() {
try {
const settings = await getSettings();
return NextResponse.json(settings);
} catch (error) {
console.log("Error getting settings:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
}
}
export async function PATCH(request) {
try {
const body = await request.json();
const settings = await updateSettings(body);
return NextResponse.json(settings);
} catch (error) {
console.log("Error updating settings:", error);
return NextResponse.json({ error: error.message }, { status: 500 });
}
}