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>
24 lines
703 B
JavaScript
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 });
|
|
}
|
|
}
|